From patchwork Fri Jul 7 18:23:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zhangjin Wu X-Patchwork-Id: 117243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp3463709vqx; Fri, 7 Jul 2023 11:33:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHagSzKVsook7gNsoO1tnaosAz4UuWxpE4K3xgFe8QRsEzcmZS/R7Kegv2nUSwUAoPZv/Q X-Received: by 2002:a17:90a:fd01:b0:259:24c4:4dd4 with SMTP id cv1-20020a17090afd0100b0025924c44dd4mr4506033pjb.10.1688754828996; Fri, 07 Jul 2023 11:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688754828; cv=none; d=google.com; s=arc-20160816; b=osEriKijEBy8Q95QZ4iOTkehFgiVzUf6jru4e7brB4HdE2bjsxzh0ooZJRcOt4atIe ICPwxd2/9RCDtGj/BOxAGP2jUtcaCzUyFoyP9Oiq66PnfPoFmbIdt2qWRi90/mEezVy3 w//5UuhuNJ5pssfDEsCA3fXN2h8cTrNJjbrebP/EP1NQGiRLm30NRid9im8kVFAIJED5 Xquixc56RpTi//j+z8/N4+6IdzCPOXd2U1J4m973iGwLU0HA+TcpQWtJElirzlF8DrA0 FF7lLMgKakiOskrFdsqCbfMKJanQJdGnrxMw3hjBkiyWq98Dk08PfclK5+gtThZQ7aci fJfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=AaAZr4N16xCwRZjcMdfa+9nVsFtqqN9717COyb+kZFo=; fh=+UJGAEU2Zd20Ffzlyw2DOtwfBiThnaWweXJeIpZW2cQ=; b=HS2ZCaPlhT5GbVqvrlsnmunLvk8MZPbG+JHgpelGUnsvbA60ExFnqGhkjgW6yKMv6r M0Uj6yFc7UpllsTfrnuxyBQRLjMTdpUwvPy9U5TiHGcaiXxpbbgdg8zXHsh2Ob+zNHGV MFsh6bbaRL8cGRym1MsHlfsIDHH+LYZs/hM6Fnwq9doVT8z5LptOOLuBzv1YqZIDhdO3 jO5ULgFcfsp9Msq+/NIoQC1n+UZ//Mdq8as+Py0BUUf2I0WRfiu/W0KCmhp6YELOJQgl G9QLv0f7CpHhHcU1uGNkv/IGc7ZA4fkjmJuVCEi+aHtipmYDvRnONKAN0NJP1Qke9Gex kCDQ== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a17090a910200b00263e299dff6si2384901pjo.74.2023.07.07.11.33.34; Fri, 07 Jul 2023 11:33:48 -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; 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 S232322AbjGGSYW (ORCPT + 99 others); Fri, 7 Jul 2023 14:24:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbjGGSYU (ORCPT ); Fri, 7 Jul 2023 14:24:20 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15DFD2126; Fri, 7 Jul 2023 11:24:18 -0700 (PDT) X-QQ-mid: bizesmtp82t1688754249t623xsi4 Received: from linux-lab-host.localdomain ( [116.30.131.119]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 08 Jul 2023 02:24:07 +0800 (CST) X-QQ-SSF: 00200000000000D0W000000A0000000 X-QQ-FEAT: 3+QwQJFiZ1m2Ploce0hyNTg1J83yb786TJK2GyCTBRIg7tzl3nHVtx+YUkoDw wUqgOD9XgSC9h8wF341Dd5ODgw8WdqB5CmFg2clJVnxtyVpKabaxf7uHI1fz7gKRZ9CaGuR 92mUPSY4EqdGtr+Zkgr3eNmHU1woh0EcRMad5poTkOVBaLPNxwb4guaZ9u6Yna0QmhT+vEA 5hJ9RpbORV0m5lK2XkqMf06LiuKws1gcCfS/TAI68wy7bVOivdy3RP1vTEgV0IGAGfG7XDv hU1Ebppi/WE2kSzDuzNYIFXrNQjI09JXU4/Id2uwsYL9NKXCYfHJMj9vDRblNup0tIkB3wu bfVRx2vnKhWpjNqimF0tqXHsJh6uJni2Ju4apqVlfql8m4fOP8= X-QQ-GoodBg: 0 X-BIZMAIL-ID: 1607707009084266309 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, thomas@t-8ch.de, =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= Subject: [PATCH v4 02/18] selftests/nolibc: stat_fault: silence NULL argument warning with glibc Date: Sat, 8 Jul 2023 02:23:45 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770787783427341716?= X-GMAIL-MSGID: =?utf-8?q?1770787783427341716?= Use another invalid address (void *)1 instead of NULL to silence this compile warning with glibc: $ make libc-test CC libc-test nolibc-test.c: In function ‘run_syscall’: nolibc-test.c:622:49: warning: null argument where non-null required (argument 1) [-Wnonnull] 622 | CASE_TEST(stat_fault); EXPECT_SYSER(1, stat(NULL, &stat_buf), -1, EFAULT); break; | ^~~~ nolibc-test.c:304:79: note: in definition of macro ‘EXPECT_SYSER2’ 304 | do { if (!cond) pad_spc(llen, 64, "[SKIPPED]\n"); else ret += expect_syserr2(expr, expret, experr1, experr2, llen); } while (0) | ^~~~ nolibc-test.c:622:33: note: in expansion of macro ‘EXPECT_SYSER’ 622 | CASE_TEST(stat_fault); EXPECT_SYSER(1, stat(NULL, &stat_buf), -1, EFAULT); break; Reviewed-by: Thomas Weißschuh Signed-off-by: Zhangjin Wu --- tools/testing/selftests/nolibc/nolibc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c index 06c561c4b09d..b4b64125d418 100644 --- a/tools/testing/selftests/nolibc/nolibc-test.c +++ b/tools/testing/selftests/nolibc/nolibc-test.c @@ -742,7 +742,7 @@ int run_syscall(int min, int max) CASE_TEST(select_stdout); EXPECT_SYSNE(1, ({ fd_set fds; FD_ZERO(&fds); FD_SET(1, &fds); select(2, NULL, &fds, NULL, NULL); }), -1); break; CASE_TEST(select_fault); EXPECT_SYSER(1, select(1, (void *)1, NULL, NULL, 0), -1, EFAULT); break; CASE_TEST(stat_blah); EXPECT_SYSER(1, stat("/proc/self/blah", &stat_buf), -1, ENOENT); break; - CASE_TEST(stat_fault); EXPECT_SYSER(1, stat(NULL, &stat_buf), -1, EFAULT); break; + CASE_TEST(stat_fault); EXPECT_SYSER(1, stat((void *)1, &stat_buf), -1, EFAULT); break; CASE_TEST(stat_timestamps); EXPECT_SYSZR(1, test_stat_timestamps()); break; CASE_TEST(symlink_root); EXPECT_SYSER(1, symlink("/", "/"), -1, EEXIST); break; CASE_TEST(unlink_root); EXPECT_SYSER(1, unlink("/"), -1, EISDIR); break;