From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Yuan Tan <tanyuan@tinylab.org>, Zhangjin Wu <falcon@tinylab.org>
Subject: Re: [PATCH v2 06/10] selftests/nolibc: make functions static if possible
Date: Tue, 1 Aug 2023 08:52:19 +0200 [thread overview]
Message-ID: <ZMiro1pwVvAzNel5@1wt.eu> (raw)
In-Reply-To: <20230801-nolibc-warnings-v2-6-1ba5ca57bd9b@weissschuh.net>
On Tue, Aug 01, 2023 at 07:30:13AM +0200, Thomas Weißschuh wrote:
> diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
> index 1555759bb164..53a3773c7790 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";
OK for this one, even desired for such a use case.
> @@ -593,7 +593,7 @@ int expect_strne(const char *expr, int llen, const char *cmp)
> #define CASE_TEST(name) \
> case __LINE__: llen += printf("%d %s", test, #name);
>
> -int run_startup(int min, int max)
> +static int run_startup(int min, int max)
> {
> int test;
> int ret = 0;
> @@ -640,7 +640,7 @@ int run_startup(int min, int max)
>
>
> /* used by some syscall tests below */
> -int test_getdents64(const char *dir)
> +static int test_getdents64(const char *dir)
> {
> char buffer[4096];
> int fd, ret;
> @@ -734,7 +734,7 @@ static int test_stat_timestamps(void)
> return 0;
> }
>
> -int test_mmap_munmap(void)
> +static int test_mmap_munmap(void)
> {
> int ret, fd, i;
> void *mem;
> @@ -796,7 +796,7 @@ int test_mmap_munmap(void)
> /* Run syscall tests between IDs <min> and <max>.
> * Return 0 on success, non-zero on failure.
> */
> -int run_syscall(int min, int max)
> +static int run_syscall(int min, int max)
> {
> struct timeval tv;
> struct timezone tz;
> @@ -907,7 +907,7 @@ int run_syscall(int min, int max)
> return ret;
> }
>
> -int run_stdlib(int min, int max)
> +static int run_stdlib(int min, int max)
> {
> int test;
> int ret = 0;
> @@ -1141,7 +1141,7 @@ static int run_protection(int min, int max)
> }
>
> /* prepare what needs to be prepared for pid 1 (stdio, /dev, /proc, etc) */
> -int prepare(void)
> +static int prepare(void)
> {
> struct stat stat_buf;
>
> @@ -1208,7 +1208,7 @@ static const struct test test_names[] = {
> { 0 }
> };
For these ones it will prevent gcc from putting breakpoints there, which
is counter-productive.
> -int is_setting_valid(char *test)
> +static int is_setting_valid(char *test)
> {
> int idx, len, test_len, valid = 0;
> char delimiter;
OK for this one.
Willy
next prev parent reply other threads:[~2023-08-01 6:52 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 5:30 [PATCH v2 00/10] tools/nolibc: enable compiler warnings Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 01/10] tools/nolibc: drop unused variables Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 02/10] tools/nolibc: sys: avoid implicit sign cast Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 03/10] tools/nolibc: stdint: use int for size_t on 32bit Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 04/10] selftests/nolibc: drop unused variables Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 05/10] selftests/nolibc: mark test helpers as potentially unused Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 06/10] selftests/nolibc: make functions static if possible Thomas Weißschuh
2023-08-01 6:52 ` Willy Tarreau [this message]
2023-08-01 7:34 ` Thomas Weißschuh
2023-08-01 8:13 ` Willy Tarreau
2023-08-01 8:50 ` Thomas Weißschuh
2023-08-01 9:13 ` Willy Tarreau
2023-08-01 5:30 ` [PATCH v2 07/10] selftests/nolibc: avoid unused arguments warnings Thomas Weißschuh
2023-08-01 8:07 ` Willy Tarreau
2023-08-01 8:13 ` Thomas Weißschuh
2023-08-01 10:15 ` Zhangjin Wu
2023-08-01 10:17 ` Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 08/10] selftests/nolibc: avoid sign-compare warnings Thomas Weißschuh
2023-08-01 5:48 ` Zhangjin Wu
2023-08-01 5:57 ` Thomas Weißschuh
2023-08-01 6:50 ` Zhangjin Wu
2023-08-01 5:30 ` [PATCH v2 09/10] selftests/nolibc: test return value of read() in test_vfprintf Thomas Weißschuh
2023-08-01 6:59 ` Willy Tarreau
2023-08-01 7:48 ` Thomas Weißschuh
2023-08-01 5:30 ` [PATCH v2 10/10] selftests/nolibc: enable compiler warnings Thomas Weißschuh
2023-08-02 20:22 ` [PATCH v2 00/10] tools/nolibc: " Willy Tarreau
2023-08-02 21:10 ` Thomas Weißschuh
2023-08-03 2:10 ` Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZMiro1pwVvAzNel5@1wt.eu \
--to=w@1wt.eu \
--cc=falcon@tinylab.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=shuah@kernel.org \
--cc=tanyuan@tinylab.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).