lkml.org 
[lkml]   [2023]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH v3 08/14] selftests/nolibc: make functions static if possible
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>
---
tools/testing/selftests/nolibc/nolibc-test.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index 154ec4787e8d..ea420c794536 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -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 @@ int test_mmap_munmap(void)
return !!ret;
}

-static int test_pipe(void)
+int test_pipe(void)
{
const char *const msg = "hello, nolibc";
int pipefd[2];
@@ -1231,7 +1231,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;
--
2.41.0

\
 
 \ /
  Last update: 2023-08-03 09:30    [W:0.075 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site