selftests/powerpc: Add generic read/write file util
authorBenjamin Gray <bgray@linux.ibm.com>
Fri, 3 Feb 2023 00:39:43 +0000 (11:39 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 9 Feb 2023 12:56:45 +0000 (23:56 +1100)
commita974f0c131891027fe8490e654a220151b4caa82
treec34ee66a72c63ea337253cdcdb399e933843aedf
parentb505063910c134778202dfad9332dfcecb76bab3
selftests/powerpc: Add generic read/write file util

File read/write is reimplemented in about 5 different ways in the
various PowerPC selftests. This indicates it should be a common util.

Add a common read_file / write_file implementation and convert users
to it where (easily) possible.

Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230203003947.38033-2-bgray@linux.ibm.com
tools/testing/selftests/powerpc/dscr/dscr.h
tools/testing/selftests/powerpc/dscr/dscr_sysfs_test.c
tools/testing/selftests/powerpc/include/utils.h
tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c
tools/testing/selftests/powerpc/pmu/lib.c
tools/testing/selftests/powerpc/ptrace/core-pkey.c
tools/testing/selftests/powerpc/utils.c