diff options
author | Benjamin Gray <bgray@linux.ibm.com> | 2023-02-03 01:39:47 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-02-09 13:56:45 +0100 |
commit | 8d7253dc447473dfcf3f09fb0fa2bd6f7d05b43b (patch) | |
tree | cbf5ab6fd7a01894b5482ba47c5d6d95dfded4e4 /tools/testing/selftests/powerpc/include | |
parent | selftests/powerpc: Add {read,write}_{long,ulong} (diff) | |
download | linux-8d7253dc447473dfcf3f09fb0fa2bd6f7d05b43b.tar.xz linux-8d7253dc447473dfcf3f09fb0fa2bd6f7d05b43b.zip |
selftests/powerpc: Add automatically allocating read_file
A couple of tests roll their own auto-allocating file read logic.
Add a generic implementation and convert them to use it.
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-6-bgray@linux.ibm.com
Diffstat (limited to 'tools/testing/selftests/powerpc/include')
-rw-r--r-- | tools/testing/selftests/powerpc/include/utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/include/utils.h b/tools/testing/selftests/powerpc/include/utils.h index 311ddc124ebc..eed7dd7582b2 100644 --- a/tools/testing/selftests/powerpc/include/utils.h +++ b/tools/testing/selftests/powerpc/include/utils.h @@ -42,6 +42,7 @@ int parse_ulong(const char *buffer, size_t count, unsigned long *result, int bas int read_file(const char *path, char *buf, size_t count, size_t *len); int write_file(const char *path, const char *buf, size_t count); +int read_file_alloc(const char *path, char **buf, size_t *len); int read_long(const char *path, long *result, int base); int write_long(const char *path, long result, int base); int read_ulong(const char *path, unsigned long *result, int base); |