Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp277862rdb; Thu, 2 Nov 2023 03:36:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHe9w9pIY0NhIt79Em/XeNQGChhdROy0sP2vNxMSOEEyX/YJifvFSJt5+ryRUdkKj8isANM X-Received: by 2002:a05:6871:5a87:b0:1e9:dd69:2fc1 with SMTP id oo7-20020a0568715a8700b001e9dd692fc1mr25085656oac.7.1698921361226; Thu, 02 Nov 2023 03:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698921361; cv=none; d=google.com; s=arc-20160816; b=ibhYkKTxa1c0nOHbNI2zwB+JclHC1VrTkV8TDd1Ppsfc08BJDI+Ba6+/41UcgwicDg foxUgcXGuYc3rHVHZapYd3wseSmeQN4F9QQf0dk6bmVulNqVOEg/f0w0ppBr8ga8v6XB UpkIwBsBsEN9dJ173MhIjLaNIGUkLMiKhXWB77loXCey2f58fXir9Qsiyxi8IL6Vpy2o CJDQOdeafC/prVWjhyhS/+39diWZfiKsnbByCFkOwood4+3+1czZNsosYwbcFGB/Hfid iDIPgDHjQQ5lufpMxaX4t/46St6KfkLxIs2lGzPvVWM/NMw0onm0luPNLUrmPGntNVqP ZSPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZV6L7qFahrkLoodGPchbWR/JmgzeTU1O/hnOkdcGN5c=; fh=1lOSW4nCXJDZtJbe+vtgUuJuzXsy4Mf7lMhH92gBTYU=; b=ZuddCqK1v8MjD+deSWap3xMjjlC29AOsMvg69on1SeNBvzlza0Gb7E2vJauy3IqKeG cS8VqvyDr96ztMEYfiJVTpVvrD24dHwE2ugZRpZQOEQNUQaG290cOyIrmKBnpdewtaPr Bdi3zx3AOYLItmwHLmJw9nzKRsgLIBjB0/8OIVqvWcvu/K1FBJ8hNexKFCuazzKtQywD h6ym2cwI8ST9M8InxM+zbr+Z+dW+xObpLAS3YyZ/e0dvrzp91+r7lJsmVJ09funl4M5Q 1SpPruE3ADazrtrRnEK81kN9CqFKjrlTwrdLsJ9eWkb51p48gnASqThBq/LfD7ogDqGE 6gJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hp/SNoSV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bq13-20020a056a02044d00b00573f94e8b83si1753597pgb.265.2023.11.02.03.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 03:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hp/SNoSV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0292D80C47BC; Thu, 2 Nov 2023 03:35:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347106AbjKBKfr (ORCPT + 99 others); Thu, 2 Nov 2023 06:35:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346324AbjKBKfp (ORCPT ); Thu, 2 Nov 2023 06:35:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57FE0131; Thu, 2 Nov 2023 03:35:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3ABAC433C9; Thu, 2 Nov 2023 10:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698921343; bh=1nnK+BgW97TZtPhAGFwIN2pVL9Lwel3zDlxOeK1GZE0=; h=From:To:Cc:Subject:Date:From; b=hp/SNoSVOXUm2gBmEt7NCjTtCofg8ToWbsBifF9Kd3r4tUtWuioL9hwqtS+CbRTM5 +44EtvxUoltEK16bErmJlLfv13KoegLIHu+lWMDkJ05A1Z6Mplzq2NQR4UT28EmkuJ 3MN01IJD4ycpIjkpqCnSteIwuhTNqZRYX3zkWFu2xIXocS9tou+zuQi6NhDqUBujgM vebm2NL3NQbQJHibw5K1q8LchYPPPfc7KHfsBd98HyiU2YPYViZozcW3OR0nZilgu7 rXFs7ypd5omEGDhwVRfZkmXb8+llmhTOMLF/3CaanKJUmmk7P9voV0An2U9BjbsVk2 05su5Veo2NFGg== From: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= To: Andrii Nakryiko , Mykola Lysenko , bpf@vger.kernel.org, Daniel Borkmann , netdev@vger.kernel.org Cc: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Alexei Starovoitov , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Larysa Zaremba Subject: [PATCH bpf] selftests/bpf: Fix broken build where char is unsigned Date: Thu, 2 Nov 2023 11:35:37 +0100 Message-Id: <20231102103537.247336-1-bjorn@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 03:35:59 -0700 (PDT) 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 --- 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