Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5307424rwb; Mon, 31 Jul 2023 23:42:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGY8wiJXaVeFKAt7u3dkYbf6fHclIgDn7zwlmR2pEK+dOPi4B5V1cv7lVjWZkThzBZWlGrc X-Received: by 2002:a05:6830:144d:b0:6b9:9bce:bfcd with SMTP id w13-20020a056830144d00b006b99bcebfcdmr11416591otp.34.1690872141122; Mon, 31 Jul 2023 23:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690872141; cv=none; d=google.com; s=arc-20160816; b=HB0Pmgm4Y8h3FslfAIZ34yj2BmK/onuUXjx0gj0GCxH1YijOhPUB6nLEbr8F50QIqW PvgWa1p+QxT3pr5SC+dQ7JJHG20MojW9GoRbZvYaGO44R/TIMfiopoRTaWhk1I718zeh Y+EMbk422SotdF3p84L7S1hWk94Zi1iPuowivCCF/ZBpAQ5nANiF+P8Y7Sl9Er0aY5bl beOmFsRORcyDzASg5bxBSiz8++gFZYMK5b2GuTelCtJuryg3k2CTuVBmkA5tpbp+eME8 6/9qMAg4mi4NBeUVJr4QEjoyLsvWQyR0A04i+GUldy9ka112DL7keeJ9C6EtjI2rWIab b5LQ== 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=Ss4Ym+aZzjcfN0Od2HKU20d5pU42ucKTJc1GasJYVC0=; fh=UZfhiU2pgwvZdBOe9fFEhnfTQX0/6KsvXKQubWsfhik=; b=oikq7HukX8PD1Cfs709wAQ+Z/cvuewT6u/DLcvHTgFgML7TYQd4u5PS4+Bzto8xV75 q3smHlWuQr2zBaIBRjlcc8m+YmNqkme0t4PTjZhs+g1bs5Wz2Nqsb2rMZAIhMITstDV6 iTlkhjt4XnzDDK4brGYCtB2AZr+NzNx4ZzWmPDmStCkDQjTcnZkdddnGUiE34NBNixme f/q1vXsj/vLDkjkLo1TF0m055T+fOO+WjBzqD6xHphDsrGdcC0CmHT2G3corpeojX2zE np0pLofjpaf/kMz8SkaknlZYuKhATAIMwk/WCvcSe0UxrnB+6+4xgy0St4TXzxg+z3Hi Iz0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b="Yq19FH/D"; 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 h125-20020a636c83000000b005640642a1dfsi6812582pgc.102.2023.07.31.23.42.08; Mon, 31 Jul 2023 23:42:21 -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="Yq19FH/D"; 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 S230343AbjHAFak (ORCPT + 99 others); Tue, 1 Aug 2023 01:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbjHAFaX (ORCPT ); Tue, 1 Aug 2023 01:30:23 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B7F1FC6; Mon, 31 Jul 2023 22:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1690867813; bh=IgjLrXapLUyrHe3QIhxAoxZT1uWllcSWJz1V8L+G1yU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Yq19FH/D4gFvCvGG+FLJ4e8m7mSmbZMJ8oKL0JPgpzl8mMmJTMYt4GMH5LzJ08fRu gvWH+zBimOttLfS/OICkpHz/kWyYfnr4CfvSyOjodkKhDIX2GD9xvdUbv31e2QoTIm WY/QDcQ2bkSoeaJ59lnWGPRYMTKXKGIjTka6iyn0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Tue, 01 Aug 2023 07:30:13 +0200 Subject: [PATCH v2 06/10] selftests/nolibc: make functions static if possible MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230801-nolibc-warnings-v2-6-1ba5ca57bd9b@weissschuh.net> References: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net> In-Reply-To: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@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=1690867811; l=2423; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=IgjLrXapLUyrHe3QIhxAoxZT1uWllcSWJz1V8L+G1yU=; b=w25nddOU5uOwRkjgP9UtA/ejR4rshXc6sRpWgDkm3xvpc8I6XGN03VoEMhM41hQIZbGjb+4tK rAFxCxanxBhDQC7u9ejvxT0uvqDNylbialOlKhWUnS1xzy2WsNCLmsW 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,SPF_PASS,T_SCC_BODY_TEXT_LINE, T_SPF_HELO_TEMPERROR,URIBL_BLOCKED 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 This allows the compiler to generate warnings if they go unused. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/nolibc/nolibc-test.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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"; @@ -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 and . * 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 } }; -int is_setting_valid(char *test) +static int is_setting_valid(char *test) { int idx, len, test_len, valid = 0; char delimiter; -- 2.41.0