Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4049009rwb; Sun, 30 Jul 2023 23:43:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFWdW5caWoUyoErZGIeGH1y0KB7RykIq5EQj4pFM1OUFw2RyHYO5KuGAjl4MgGM5l6cIxGR X-Received: by 2002:a17:906:53d3:b0:978:928:3b99 with SMTP id p19-20020a17090653d300b0097809283b99mr6576112ejo.46.1690785793349; Sun, 30 Jul 2023 23:43:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690785793; cv=none; d=google.com; s=arc-20160816; b=qMFjMB69EZCGqFYpg/K4Zo3XvIg42wOm12v4+iDfUjYoEHmR5DnpDaf3lDt1o1Rnmj H9Ngm82R/5PudPZmPo8XVsIHp4wumgYjjhe9ycNJfueiO2YJ5ToGVXZMx75wRPK901nf oYeWnEyv8kbtuq0pV0sPEA2s5y0jgI7vQ12h2GIE//dEPsAG5DaLpobLKO9WN4QR64gj I2akxgwtaPnP8U7sxsX3HfAEC5aliEsTH1wd8J6d7nX+uBqll31WMg1yEArm7xfPnuif BKso8B1tM61kf2cOyy58W832ZtRv7/IcRrCpPZSyoosnPgGhT4aDIRQKxywZBghKZahp HX8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=B2aKwqu7QYJdOEUsF9gmJGgThjP9P+6grk0TLOykd7Q=; fh=UZfhiU2pgwvZdBOe9fFEhnfTQX0/6KsvXKQubWsfhik=; b=gedcr66RlFYg63z82UodWhvjNIw6YB3obj0ZXD6rgx3+87dWaXp/JhjsQ+ImqAejTJ hnDJrzWrmQV9SxcJPX6tfQ3tQYTNuJOAu3h/I4RUCYmAofvs6fehAQQvX+vIpHNb+9YG zaJamq1X37tsj1ME/MKmosU+Ou5eRPjlqe2AG5XeDtka53RskEbDuItRjUwxWpBSKaLw Yym2urpfA3+bgSPuCZcS+e+c4tWkcZ6TGZGmqyj+ohcmdt22hFQ+8fmH6i2SiGpAhdK9 pHohToprvRHC+uwlwc4fDjA+7+6KCVMS9XH35On38/3pVf+IU/DgQ6zmtMm79/l3qqqA DZQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b="ruZdxOu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t25-20020a1709066bd900b0099263f8cdc4si6407178ejs.207.2023.07.30.23.42.49; Sun, 30 Jul 2023 23:43:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b="ruZdxOu/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230238AbjGaG1J (ORCPT + 99 others); Mon, 31 Jul 2023 02:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbjGaG1D (ORCPT ); Mon, 31 Jul 2023 02:27:03 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1BCBE57; Sun, 30 Jul 2023 23:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690784818; bh=ZTNcL4vPTjZ60aMHUaWTT+59KbRfzXeF9WrWuByRCEI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ruZdxOu/eS/x3/+CLg+xzeVSY2IKEkodIm3Pz6b0M9r99xWRNWQ1b7JQModhN6Cva h0NrlgrkRBYe4gHBmoidnteUOzwfqYVHWgj416iB6EfxPLmD0QsCAe00gtbdC0OaqC Q2GG9bcZOu/a8ttRKlKnvzcJZDSn/B/bamdymzPQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 31 Jul 2023 08:26:56 +0200 Subject: [PATCH 1/4] selftests/nolibc: drop unused test helpers MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230731-nolibc-warnings-v1-1-74973d2a52d7@weissschuh.net> References: <20230731-nolibc-warnings-v1-0-74973d2a52d7@weissschuh.net> In-Reply-To: <20230731-nolibc-warnings-v1-0-74973d2a52d7@weissschuh.net> To: Willy Tarreau , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan , Zhangjin Wu , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1690784818; l=4552; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ZTNcL4vPTjZ60aMHUaWTT+59KbRfzXeF9WrWuByRCEI=; b=t3OE1zDz2rqRRHzMsf9yzWP9Si7c7FBETEnjLOpezbzOQsTduTB7DDKYWmO1G4ASQJsw01jK+ RA17MHV1rFtAjjTQeUJU26jwDOzHkSRSu+ECvk0XAnv6Y3p1FbDRaQ2 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) -{ - 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; -} - #define EXPECT_EQ(cond, expr, val) \ do { if (!(cond)) result(llen, SKIPPED); else ret += expect_eq(expr, llen, val); } while (0) @@ -239,19 +214,6 @@ static int expect_gt(int expr, int llen, int val) } -#define EXPECT_LE(cond, expr, val) \ - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_le(expr, llen, val); } while (0) - -static int expect_le(int expr, int llen, int val) -{ - int ret = !(expr <= val); - - llen += printf(" = %d ", expr); - result(llen, ret ? FAIL : OK); - return ret; -} - - #define EXPECT_LT(cond, expr, val) \ do { if (!(cond)) result(llen, SKIPPED); else ret += expect_lt(expr, llen, val); } while (0) @@ -348,24 +310,6 @@ static int expect_syserr2(int expr, int expret, int experr1, int experr2, int ll } -#define EXPECT_PTRZR(cond, expr) \ - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrzr(expr, llen); } while (0) - -static int expect_ptrzr(const void *expr, int llen) -{ - int ret = 0; - - llen += printf(" = <%p> ", expr); - if (expr) { - ret = 1; - result(llen, FAIL); - } else { - result(llen, OK); - } - return ret; -} - - #define EXPECT_PTRNZ(cond, expr) \ do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrnz(expr, llen); } while (0) @@ -417,18 +361,6 @@ static int expect_ptrne(const void *expr, int llen, const void *cmp) return ret; } -#define EXPECT_PTRGE(cond, expr, cmp) \ - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrge(expr, llen, cmp); } while (0) - -static int expect_ptrge(const void *expr, int llen, const void *cmp) -{ - int ret = !(expr >= cmp); - - llen += printf(" = <%p> ", expr); - result(llen, ret ? FAIL : OK); - return ret; -} - #define EXPECT_PTRGT(cond, expr, cmp) \ do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrgt(expr, llen, cmp); } while (0) @@ -442,19 +374,6 @@ static int expect_ptrgt(const void *expr, int llen, const void *cmp) } -#define EXPECT_PTRLE(cond, expr, cmp) \ - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrle(expr, llen, cmp); } while (0) - -static int expect_ptrle(const void *expr, int llen, const void *cmp) -{ - int ret = !(expr <= cmp); - - llen += printf(" = <%p> ", expr); - result(llen, ret ? FAIL : OK); - return ret; -} - - #define EXPECT_PTRLT(cond, expr, cmp) \ do { if (!(cond)) result(llen, SKIPPED); else ret += expect_ptrlt(expr, llen, cmp); } while (0) @@ -546,24 +465,6 @@ static int expect_streq(const char *expr, int llen, const char *cmp) } -#define EXPECT_STRNE(cond, expr, cmp) \ - do { if (!(cond)) result(llen, SKIPPED); else ret += expect_strne(expr, llen, cmp); } while (0) - -static int expect_strne(const char *expr, int llen, const char *cmp) -{ - int ret = 0; - - llen += printf(" = <%s> ", expr); - if (strcmp(expr, cmp) == 0) { - ret = 1; - result(llen, FAIL); - } else { - result(llen, OK); - } - return ret; -} - - /* declare tests based on line numbers. There must be exactly one test per line. */ #define CASE_TEST(name) \ case __LINE__: llen += printf("%d %s", test, #name); -- 2.41.0