Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp296981rdb; Thu, 2 Nov 2023 04:14:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFELUq7fDyOLzqaiIHmoXRVhzEk/oa/DemOHGeSV+GFvTmSTsePORbn/w6+bytDNvxAOLFK X-Received: by 2002:a05:6a21:7803:b0:181:3129:363 with SMTP id be3-20020a056a21780300b0018131290363mr6620653pzc.58.1698923692783; Thu, 02 Nov 2023 04:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698923692; cv=none; d=google.com; s=arc-20160816; b=MxWr0zwJsUE2O/moNZA7grNCLPUCClX94FjQF4v8jl1six4ZjWQcni6t0j6sWE5kKY COA1MBT8YQT/dRhSMtvZ4UL1dEM7bDwKWTvZrcr3n6OQZfdR8bg3QMvixpQC7R1OOINk B6D2dvnle1tP/7K4OP0MORH16LkEX94MRfFeMKNHsU+r86Y/0lKw7JZXD7xDK5z2i0dk Gj6IoQZLV1YPN5GfslC/9GqjcMQnfGM8xCGg8I3gVADG+xA8ZlkygYmJmfqHACtEsWcf BDNED742upw8x3Mq4Um3hrf58A+kim5GhZsI1Jfpj7LcP4rGfsIImmdRL8zCc5zEhInB SpDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=o58wFnf6szPGgzlryUFb1pArzVhpE+Bc8B/ye0mh1Ic=; fh=QL45df+J9/d+wc7qDzbBhUZWKGNApw6x2Ln7aejk23o=; b=Lw7m3YYNQH2E5K/2N2RqzazvQeFqYub0XOAxdFenXj8qYVdFZYGXMRrlyt1nspefBD 6XS2q5Ul1tGoMp3QNg+N28YqkLaBnLvsQ9Fi8Busjtim0cumyqQCzT+9d89RLw4UV0Pn ++3F+qsrbBHU+QzmXUS+r/3N+uboqHZQYVywL8Gkyfb1RI5N1xdQrA4bx96lBVqmvyTB Eal4inTF1GxahwIfdZrBrkXtJnzTsSLKQQPxhvbMEf8Ts+eT/Iv2b/xtk3LZKMr/64r0 B9Qj58ahoQBRiJBz9NJPk8L0DCeVeZ5rOBnPHAScxtlLCxUnUARYop4VVDwRZ8r8ykAG p4GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U53jqP9V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z11-20020a170903018b00b001cc47e75d58si5168135plg.512.2023.11.02.04.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 04:14:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U53jqP9V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 04C3C8213F25; Thu, 2 Nov 2023 04:14:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229654AbjKBLOo (ORCPT + 99 others); Thu, 2 Nov 2023 07:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjKBLOn (ORCPT ); Thu, 2 Nov 2023 07:14:43 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D65BAE7 for ; Thu, 2 Nov 2023 04:14:37 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c50fbc218bso9975371fa.3 for ; Thu, 02 Nov 2023 04:14:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698923676; x=1699528476; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o58wFnf6szPGgzlryUFb1pArzVhpE+Bc8B/ye0mh1Ic=; b=U53jqP9VsUBak53Y5BfKYfegk3kaVH4KZAkUP0KAhHPKM/eAbu3Dhyy2tSC/G70F16 pLEfg6e/NzHbe30i0hvgPA2D0qvph/Iza4vRoYLPLavuHyAUlz21bQsaWMWWffq31Y/u BLEEulyy+BSJz7zVF24Xj6Se21AQ9seOR9HcWAhMTrGE4tC6zAS1BN7rRb2XDSOze1MP Ggox8NcFXFQVfDLjqcbHTzinBsBtnaRybKmPymlBwQRt74BVx6uM/mwSMWFg5aCzr23Q L4yJLhnYyNYhwmgWa8c4VKYmMz+sT5S266ehiOmXNS09PIS+a+sOHgXWTOI3UMvwe4yK Fkrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698923676; x=1699528476; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o58wFnf6szPGgzlryUFb1pArzVhpE+Bc8B/ye0mh1Ic=; b=AydoT+RIPVFqB57h8NZBx+stG0px8H4r9nqy9k+rE9ZfTsbtV8iMl5b0n80hmC++EQ iicdJRCi/TWTD971uXByfphOyVmT7P7ih42obiVA0IEHI9mOOuMnBChnM9tjscwyG9qm Zk6vDdQT6DcOW/6ko021udcLFvq08rpbWIfzEKN/eCoiGqqhYBQYMDtTf6qJyPXVW2Z4 XI2qfvFPEDaWN6hD6voEColsnsk77NIImd354xFbuG9gbWPvlApPWtlTVQCHROqQCfz/ 2434LU3k2rj2IyGwoYi0omFI6/qZs+n2VVbOvIS9u0crabBaZYeL6uardfK99Xac0nBG 6bMA== X-Gm-Message-State: AOJu0YznhRtQbUjR++W67EiISLtH+WaKthby/zXjvXVjxm7eV2RMt+jp Kuuc/rU7ZJNi+0g82FJy2AmroQ== X-Received: by 2002:a2e:be10:0:b0:2c4:fdc9:c8a3 with SMTP id z16-20020a2ebe10000000b002c4fdc9c8a3mr16743697ljq.50.1698923676107; Thu, 02 Nov 2023 04:14:36 -0700 (PDT) Received: from mutt (c-9b0ee555.07-21-73746f28.bbcust.telenor.se. [85.229.14.155]) by smtp.gmail.com with ESMTPSA id bd4-20020a05651c168400b002c6ee08c2casm215421ljb.105.2023.11.02.04.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 04:14:35 -0700 (PDT) Date: Thu, 2 Nov 2023 12:14:33 +0100 From: Anders Roxell To: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, Daniel Borkmann , netdev@vger.kernel.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Larysa Zaremba Subject: Re: [PATCH bpf] selftests/bpf: Fix broken build where char is unsigned Message-ID: <20231102111433.GA364395@mutt> References: <20231102103537.247336-1-bjorn@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231102103537.247336-1-bjorn@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) 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,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 04:14:48 -0700 (PDT) On 2023-11-02 11:35, Björn Töpel wrote: > From: Björn Töpel > > There are architectures where char is not signed. If so, the following > error is triggered: > > | xdp_hw_metadata.c:435:42: error: result of comparison of constant -1 \ > | with expression of type 'char' is always true \ > | [-Werror,-Wtautological-constant-out-of-range-compare] > | 435 | while ((opt = getopt(argc, argv, "mh")) != -1) { > | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~ > | 1 error generated. > > Correct by changing the char to int. > > Fixes: bb6a88885fde ("selftests/bpf: Add options and frags to xdp_hw_metadata") > Signed-off-by: Björn Töpel Thank you for the patch. I saw the same failure when I built selftests/bpf for arm64. With this patch ontop of today's next-20231102, fixes that build issue. Tested-by: Anders Roxell Cheers, Anders > --- > tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c b/tools/testing/selftests/bpf/xdp_hw_metadata.c > index 17c0f92ff160..c3ba40d0b9de 100644 > --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c > +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c > @@ -430,7 +430,7 @@ static void print_usage(void) > > static void read_args(int argc, char *argv[]) > { > - char opt; > + int opt; > > while ((opt = getopt(argc, argv, "mh")) != -1) { > switch (opt) { > > base-commit: cb3c6a58be50c65014296aa3455cae0fa1e82eac > -- > 2.40.1 >