Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5329750rwb; Tue, 1 Aug 2023 00:10:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlHgrIjGAbROz0C4Mdc1BGIn82vgbDBcsBWKfPxmny4uqze9FSEA2AW59mpyj1QFKGXvKLEJ X-Received: by 2002:a05:6a21:4849:b0:126:a80d:4960 with SMTP id au9-20020a056a21484900b00126a80d4960mr11469979pzc.30.1690873845043; Tue, 01 Aug 2023 00:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690873845; cv=none; d=google.com; s=arc-20160816; b=09rNYXbaobbruKT4vqLFMrwuev0a1kBLOXE5vvFeofiqxmK+CyoNgv7Y1NhIP3X8bO TBEG5No7qhtf1hICS+7b9+z6dbL3ukinenYFOhdA61P+QePuqQg11Zt0RbeA20UvRrXy GmjBbbJYzPIHhgkgnRMldECalQUIt4rSdzbCIgWiL/gY8ZzSMwklILJLZdnFvrmOc6ZH lz5rbq+9yWpgbwMBN31oYVIsJ9PLW65dszosTZB/lqVmmuyakm2yRt6qU6vUKqdDIUtO YTfSGt7IL0k1ruNKUL31RTWjoSqWSMaowZT1UTHMcsnM/CXB4xx88xklabXzueYRrNDg +DaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lZcTus6xYaFc0aedD6ReTisv0zTDzElAvrXl27idgio=; fh=TTF1lt49Sby0rKay1qRjEqWFbUkg3/0Ba8LROUDUaGE=; b=q/P/J+OudRIW38mbI5rzZofwrow3J+6FRH/7n0cQla1c0UDq4JhaCaLxJjFOpLb60x UjUNzsgAQo7xvRrgI8adAePedBaV35r64xC/Wl4lD5Mmh6SaiC4NQOOS8npJtZrcYahU ItVaL3JBG+GfM0XYLVsMN3/5YauHBLrc4K1Jakw+UsL7GQtBZCgv9i4Lt4nk+GL3B1lR Ah2ZQDLeQtzw28p/i5/N1BtuTFpK1+OivvDRwvgLlGB9xmw68I+RnR6c4huLb/IrrLjR oOAeVlifnRabkBIb/bNdxdS6t1SjLeY9I5BzWBYVgOlgx0lh935VcPQFMdjed8ezopL1 29dw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b23-20020a63cf57000000b005538e9fb8cbsi8223205pgj.550.2023.08.01.00.10.32; Tue, 01 Aug 2023 00:10:45 -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 S230303AbjHAGwa (ORCPT + 99 others); Tue, 1 Aug 2023 02:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjHAGw3 (ORCPT ); Tue, 1 Aug 2023 02:52:29 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7E607BF; Mon, 31 Jul 2023 23:52:28 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 3716qJIH030318; Tue, 1 Aug 2023 08:52:19 +0200 Date: Tue, 1 Aug 2023 08:52:19 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Yuan Tan , Zhangjin Wu Subject: Re: [PATCH v2 06/10] selftests/nolibc: make functions static if possible Message-ID: References: <20230801-nolibc-warnings-v2-0-1ba5ca57bd9b@weissschuh.net> <20230801-nolibc-warnings-v2-6-1ba5ca57bd9b@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230801-nolibc-warnings-v2-6-1ba5ca57bd9b@weissschuh.net> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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 On Tue, Aug 01, 2023 at 07:30:13AM +0200, Thomas Wei?schuh wrote: > 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"; OK for this one, even desired for such a use case. > @@ -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 } > }; For these ones it will prevent gcc from putting breakpoints there, which is counter-productive. > -int is_setting_valid(char *test) > +static int is_setting_valid(char *test) > { > int idx, len, test_len, valid = 0; > char delimiter; OK for this one. Willy