From 8d7253dc447473dfcf3f09fb0fa2bd6f7d05b43b Mon Sep 17 00:00:00 2001 From: Benjamin Gray Date: Fri, 3 Feb 2023 11:39:47 +1100 Subject: 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 Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20230203003947.38033-6-bgray@linux.ibm.com --- tools/testing/selftests/powerpc/include/utils.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/testing/selftests/powerpc/include') 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); -- cgit v1.2.3