From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Zhangjin Wu <falcon@tinylab.org>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
shuah@kernel.org, tanyuan@tinylab.org, w@1wt.eu
Subject: Re: [PATCH 1/4] selftests/nolibc: drop unused test helpers
Date: Mon, 31 Jul 2023 09:08:15 +0200 [thread overview]
Message-ID: <7d8dee88-16af-464f-b7f3-55b77dbc3c46@t-8ch.de> (raw)
In-Reply-To: <20230731064826.16584-1-falcon@tinylab.org>
Note:
It seems your mail client does not add the prefix "Re: " to responses.
Is that intentional?
On 2023-07-31 14:48:26+0800, Zhangjin Wu wrote:
> Hi, Thomas
>
> > As we want to enable compiler warnings in the future these would be
> > reported as unused functions.
> >
> > If we need them in the future they are easy to recreate from their still
> > existing siblings.
> >
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> > tools/testing/selftests/nolibc/nolibc-test.c | 99 ----------------------------
> > 1 file changed, 99 deletions(-)
> >
> > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
> > index 03b1d30f5507..53e2d448eded 100644
> > --- a/tools/testing/selftests/nolibc/nolibc-test.c
> > +++ b/tools/testing/selftests/nolibc/nolibc-test.c
> > @@ -161,31 +161,6 @@ static void result(int llen, enum RESULT r)
> > * of failures, thus either 0 or 1.
> > */
> >
> > -#define EXPECT_ZR(cond, expr) \
> > - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_zr(expr, llen); } while (0)
> > -
> > -static int expect_zr(int expr, int llen)
> > -{
>
> Why not a simple 'static __attribute__((unused))' line, then, no need to
> add them again next time.
>
> -static int expect_zr(int expr, int llen)
> +static __attribute__((unused))
> +int expect_zr(int expr, int llen)
> {
Personally I don't like having dead code lying around that needs to be
maintained and skipped over while reading.
It's not a given that we will need those helpers in the future at all.
Thomas
>
> Thanks,
> Zhangjin
>
> > - int ret = !(expr == 0);
> > -
> > - llen += printf(" = %d ", expr);
> > - result(llen, ret ? FAIL : OK);
> > - return ret;
> > -}
> > -
> > -
> > -#define EXPECT_NZ(cond, expr, val) \
> > - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_nz(expr, llen; } while (0)
> > -
> > -static int expect_nz(int expr, int llen)
> > -{
> > - int ret = !(expr != 0);
> > -
> > - llen += printf(" = %d ", expr);
> > - result(llen, ret ? FAIL : OK);
> > - return ret;
> > -}
> > -
> > [...]
> > --
> > 2.41.0
> >
> >
next prev parent reply other threads:[~2023-07-31 7:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 6:26 [PATCH 0/4] tools/nolibc: enable compiler warnings Thomas Weißschuh
2023-07-31 6:26 ` [PATCH 1/4] selftests/nolibc: drop unused test helpers Thomas Weißschuh
2023-07-31 6:48 ` Zhangjin Wu
2023-07-31 7:08 ` Thomas Weißschuh [this message]
2023-07-31 7:32 ` Zhangjin Wu
2023-07-31 8:23 ` Thomas Weißschuh
2023-07-31 11:02 ` Zhangjin Wu
2023-07-31 15:30 ` Thomas Weißschuh
2023-07-31 16:53 ` Willy Tarreau
2023-07-31 18:36 ` Thomas Weißschuh
2023-07-31 22:49 ` Willy Tarreau
2023-07-31 6:26 ` [PATCH 2/4] selftests/nolibc: drop unused variables Thomas Weißschuh
2023-07-31 6:26 ` [PATCH 3/4] tools/nolibc: " Thomas Weißschuh
2023-07-31 6:26 ` [PATCH 4/4] selftests/nolibc: enable -Wall compiler warnings Thomas Weißschuh
2023-07-31 7:17 ` Zhangjin Wu
2023-07-31 8:10 ` Thomas Weißschuh
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=7d8dee88-16af-464f-b7f3-55b77dbc3c46@t-8ch.de \
--to=linux@weissschuh.net \
--cc=falcon@tinylab.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=tanyuan@tinylab.org \
--cc=w@1wt.eu \
/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
all inboxes | Powered by JetHome®