selftests/nolibc: make functions static if possible
authorThomas Weißschuh <linux@weissschuh.net>
Thu, 3 Aug 2023 07:28:52 +0000 (09:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2023 03:17:07 +0000 (05:17 +0200)
This allows the compiler to generate warnings if they go unused.

Functions that are supposed to be used as breakpoints should not be
static, so un-statify those if necessary.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/testing/selftests/nolibc/nolibc-test.c

index b7d1a996626be7e6754c4dded527bb7fb048a27e..da9926e6ec822a5a87acc77320bbc036383be9a4 100644 (file)
@@ -80,7 +80,7 @@ char *itoa(int i)
 /* returns the error name (e.g. "ENOENT") for common errors, "SUCCESS" for 0,
  * or the decimal value for less common ones.
  */
-const char *errorname(int err)
+static const char *errorname(int err)
 {
        switch (err) {
        case 0: return "SUCCESS";
@@ -659,7 +659,7 @@ int test_getdents64(const char *dir)
        return ret;
 }
 
-static int test_getpagesize(void)
+int test_getpagesize(void)
 {
        int x = getpagesize();
        int c;
@@ -688,7 +688,7 @@ static int test_getpagesize(void)
        return !c;
 }
 
-static int test_fork(void)
+int test_fork(void)
 {
        int status;
        pid_t pid;
@@ -713,7 +713,7 @@ static int test_fork(void)
        }
 }
 
-static int test_stat_timestamps(void)
+int test_stat_timestamps(void)
 {
        struct stat st;
 
@@ -793,7 +793,7 @@ end:
        return !!ret;
 }
 
-static int test_pipe(void)
+int test_pipe(void)
 {
        const char *const msg = "hello, nolibc";
        int pipefd[2];
@@ -1227,7 +1227,7 @@ static const struct test test_names[] = {
        { 0 }
 };
 
-int is_setting_valid(char *test)
+static int is_setting_valid(char *test)
 {
        int idx, len, test_len, valid = 0;
        char delimiter;