[PATCH 1/4] selftests/nolibc: drop unused test helpers

From: Zhangjin Wu
Date: Mon Jul 31 2023 - 02:48:59 EST


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@xxxxxxxxxxxxxx>
> ---
> 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)
{

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
>
>