Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp5346401rwb; Tue, 1 Aug 2023 00:33:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlEjmd+opzqTTp5de9h8BUYOGvWY1rKesNrUEX9LLuuTQ6IasRANk8gwo/rm066wUdkWPIZ7 X-Received: by 2002:a9d:7e92:0:b0:6b6:e7cb:6ead with SMTP id m18-20020a9d7e92000000b006b6e7cb6eadmr12737203otp.19.1690875196976; Tue, 01 Aug 2023 00:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690875196; cv=none; d=google.com; s=arc-20160816; b=D8JHu13fh+DcXDQFcIFWZ6qcFBPqYyFYdzvynadhsTNRMleVkUOnTw0unWaJefxI71 jEn8Hbo4alaI8SJ4Pg1+ciUaEnp38ICqKCMkGCqh+xi1iAtkqWG7rHwmFYTIXRPEZoWi 86l4S4iwxQeybleMNVDBEeYk7tmzQVRSMkXLnApy9U444cFXYzpjIZF4hoh9uH+XMaR1 xbsLBzW3r6qNA3oheRXgrVqjuVKUbqerg/1L7dOIveBHdQHTGPVl9wdMfqbeoQv2cBP2 yBbeDjtErUzyNwY21Nkvlx8MtOy+DNxi5APvwa7oQMD7XUh2X+b8ZdrLLuLrHkzf/iDW HQTA== 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=E7J3aA7qwQsjbEH0ZZ1WotHRgR0COKjaXUSCZ9JEhIY=; fh=Q4MvkSz8FYcHPE+pFaGSR8c4aLVk8U0IU8szbKVfuTg=; b=F6HIi+MDs7DRkcCIo3tCqpOSbgXe8qy0pDZuxXYR5n/a9T27Gjfj001Kg3FAbqwXZA vz+1I/OBCiCAO1m0LfgEKiCMF7Xpr1t3PoGaZ+IjUNj4btHWGCl8biRt7RNjO7zYausu PwO0LH+An62NW8CL2bRjJ+TxOmMVPf8nriw6tuGgwjG5sN1iLlbE5atrf5lqVKykc8RW /BsgtIKS3RrOmWmI+irRUqWSTngXjVDCuPl0uIcM4v6kUz9TWAiLYKcam+WiNJ7Co+kc mPNKEdWFaMhl+2h1UXqPMyjQWhogVuNk3KLlTw3l4e53cT6g4HqROGnVaaxtwWSbbmtb ju/A== 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 i127-20020a639d85000000b00557447d5721si8536880pgd.768.2023.08.01.00.33.01; Tue, 01 Aug 2023 00:33:16 -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 S231742AbjHAGus (ORCPT + 99 others); Tue, 1 Aug 2023 02:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229825AbjHAGur (ORCPT ); Tue, 1 Aug 2023 02:50:47 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 701E495; Mon, 31 Jul 2023 23:50:45 -0700 (PDT) X-QQ-mid: bizesmtp67t1690872639tqjbcrnc Received: from linux-lab-host.localdomain ( [116.30.131.233]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 01 Aug 2023 14:50:38 +0800 (CST) X-QQ-SSF: 01200000000000E0X000000A0000000 X-QQ-FEAT: 3M0okmaRx3jHCUGWX0NFc/lpwh5f04eUaebW1W4RbmvC2G8nXw6LSBKroHVAu Mu8g7QXSKsVRY9mvCtEHRMsyZZ8KC/sktUtndOVfue2kWOOCMcoKK3PS426Ci0LIOCiqcWo KhTv68PSsm8/y0j8nnYlqnefYo6eMfqexWtBOS5baX7u6Xi6ALvP7C0OnBrAcXQ+UCFVKvd gG4oPsS+u2Hx3Q4IYWp7LQ0/3EvFB84K/mxlY7ittwR9prU7S/v9CfOJwN6dRVymYBZOkBg P3ZsJV94zUc/AShNCTekKts1j76hX2zRlR4ttappGneZzZBhXAHbKQsfUXxdiN6NxHVliC7 maXHptPHWsfsOvTPAZxG1m7gtlWKba6XU02MVCI1UVdCYrL5F9fbgphenf4gAaV9Dt5QXtb X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6169436343876631260 From: Zhangjin Wu To: linux@weissschuh.net Cc: falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, tanyuan@tinylab.org, w@1wt.eu Subject: Re: [PATCH v2 08/10] selftests/nolibc: avoid sign-compare warnings Date: Tue, 1 Aug 2023 14:50:37 +0800 Message-Id: <20230801065037.38519-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <54502a41-5c35-4c79-812f-263d5e24f056@t-8ch.de> References: <54502a41-5c35-4c79-812f-263d5e24f056@t-8ch.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,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 > On 2023-08-01 13:48:19+0800, Zhangjin Wu wrote: > > > These warnings will be enabled later so avoid triggering them. > > > > > > Signed-off-by: Thomas Weißschuh > > > --- > > > tools/testing/selftests/nolibc/nolibc-test.c | 4 ++-- > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c > > > index cb17cccd0bc7..82714051c72f 100644 > > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > > @@ -749,7 +749,7 @@ static int test_mmap_munmap(void) > > > }; > > > > > > page_size = getpagesize(); > > > - if (page_size < 0) > > > + if (page_size == 0) > > > return -1; > > > > > > > It was my mistake before, but do we need to align with the one used in > > test_getpagesize(): > > > > static int test_getpagesize(void) > > { > > long x = getpagesize(); > > int c; > > > > if (x < 0) > > return x; > > > > Use 'long' instead of 'size_t' to declare page_size? > > Good point. > > Given that getpagesize() is documented as returning "int" I guess we > should actually change the implementation in nolibc. > Yes, it is documented at [1], perhaps Willy looked at this line before: This interface, returning an int, may have problems representing appropriate values in the future. Applications should use the sysconf() function instead. [1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/getpagesize.html > > Thanks, > > Zhangjin