Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3117124imw; Mon, 11 Jul 2022 02:05:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uft87DyQrOC3m/4aFdFe8KV7/+PXHoXDgkkFI+SQVUvDldP8fKxMsJA424G86x45aYi+GF X-Received: by 2002:a17:902:c245:b0:16b:e818:b75c with SMTP id 5-20020a170902c24500b0016be818b75cmr17817059plg.101.1657530346534; Mon, 11 Jul 2022 02:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657530346; cv=none; d=google.com; s=arc-20160816; b=bRhCcIRG8GYJDM8/L41J2lHie+243xPuk5KteEn5y5XwdMmlJbae4ANrSU1jeOhQmO osSL1zNggRskAWpFw6r1V8ItWQgpopjHzcsD5RhFVeHCQpzZNFuBcrqCbnGEzm48MDwy sJhuASKz1qLog141oKqtYm/1gtGoHXIlbmkg6Fo1JceZHrQ8+9tGSHTlqmFoSN9oNj63 cC8zDPRVzM/LY8bBBIhoZZJjDekkxSD39oS0DgfbVc6AV6SYFhVfioM1e54+/qMHu6sB 09aci1+/llr+8lM5aHZbfDNgFBlEti8ILuTCQ2COgrmU+vcNXMWLBYRj/4qNJEXeDsRZ m3Tw== 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=MPFKY/bHlsQhtgUJcy9UK+LhK0GjolHXo8PsK9MTO74=; b=UXWxVXzZ+6ht3d2txEm/gybjTBeJvw7OJqidvLplBvJDsQhKJ3xuSYWWWMpZvRmHV1 /HfCNWVnu7tyfO18X1gSI8wlxNO1+nmJzyYSea/5TuqIr+QzoeyCq23K1h6EUbGprtQO m8ko9DaGkByBZRKl0VGKV+Xj+Va8CCaKz6hesywMFeU08tBzr78i9+v+WHEo1K+buOSl DQCCAMBchXsspUymqyPh8LpdSAAXbSF9PkBBWRyG007cnx5utTzy76yT0GYum2ujVsjc 5u8csr1M9XE3giFYeL9RzLrfr5eB2M8cz0c5Co9M3Vpm2vOouaapiGsGOIVOG2HeRwmU KgsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="3dWItNH/"; 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 pq4-20020a17090b3d8400b001ef9c14ae23si7888025pjb.5.2022.07.11.02.05.33; Mon, 11 Jul 2022 02:05:46 -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=@tessares.net header.s=google header.b="3dWItNH/"; 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 S229729AbiGKIM2 (ORCPT + 99 others); Mon, 11 Jul 2022 04:12:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiGKIM1 (ORCPT ); Mon, 11 Jul 2022 04:12:27 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C211CFC9 for ; Mon, 11 Jul 2022 01:12:25 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id h17so5986650wrx.0 for ; Mon, 11 Jul 2022 01:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MPFKY/bHlsQhtgUJcy9UK+LhK0GjolHXo8PsK9MTO74=; b=3dWItNH/NrG2UXqFVsxOXWN+q2qqBj4vzooK3M0fqc0NW7nFtkiqcvWaIp93vV4X5t cvuXswhlr6y8zqUrdIAnLYVuT0/bBNWWTBvXhoMuA9ghuCH4JYnL2Co6bcDvoOC4NyNL 9bCZmbb8jxOvLj1zTcOoMyjoZjIdOAHWBXpO4ssyke6GlXpC73oLnxfit7nnRfO6iB7i 256ylzPv5rvMS0FCWr1MXcdyFEWc5plJLs5nVT7L83L2EGX4IHqfxBkkHMgW6NlmQk7h zCrXXf4WDBzabyhGC8I3ECzVLJqbg7Zl72pFR5tKA6tbrSzAQECZD2fYwxRbLLd9YFX/ FFbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MPFKY/bHlsQhtgUJcy9UK+LhK0GjolHXo8PsK9MTO74=; b=3itZYh+n2M6dT+vca67CUR3AtkozgHxY63upHt4IJOdSKKizi6/KF6oU2na1e5ww3d 2NRKumkUPzeVA/s7SlxWVu4az1kO88RKvSooUzPyBSLXSEDvlRxoeUMj0FM6TWsji5IZ z2pwZg+YgGzlDdoI4iD9haj2vvQpXTdB4FTV0vp6cjFHm6nxmHqilHdO9t2H225Z8CfQ txuI0RPSQhvkE5U//4n9OMIq1SRETyf7rcTbCXtQL9l2XrUYgUoRv+rKuvw+qqjyTWoM hZyM7zb6s4FtnPB6e2KYaQT0iFL8nUm81sZJqRAhrGxBXzep08OcjeZrBTmDrPFumVF+ Hmfg== X-Gm-Message-State: AJIora/mIUL12iBQ23qc6NkNvztRLmAKheB6oezdKYi0Jj2ejLPhtxXu BRC8brmqlgD+9rMNyMwj+jJ41Q== X-Received: by 2002:adf:e111:0:b0:21d:665e:2fa5 with SMTP id t17-20020adfe111000000b0021d665e2fa5mr16086610wrz.652.1657527144170; Mon, 11 Jul 2022 01:12:24 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id n4-20020a5d6604000000b0021d650e4df4sm5159809wru.87.2022.07.11.01.12.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 01:12:23 -0700 (PDT) From: Matthieu Baerts To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Eduard Zingerman Cc: mptcp@lists.linux.dev, Matthieu Baerts , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next v2] bpf: Fix 'dubious one-bit signed bitfield' warnings Date: Mon, 11 Jul 2022 10:12:00 +0200 Message-Id: <20220711081200.2081262-1-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_NONE, SPF_HELO_NONE,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 Our CI[1] reported these warnings when using Sparse: $ touch net/mptcp/bpf.c $ make C=1 net/mptcp/bpf.o net/mptcp/bpf.c: note: in included file: include/linux/bpf_verifier.h:348:26: error: dubious one-bit signed bitfield include/linux/bpf_verifier.h:349:29: error: dubious one-bit signed bitfield Set them as 'unsigned' to avoid warnings. [1] https://github.com/multipath-tcp/mptcp_net-next/actions/runs/2643588487 Fixes: 1ade23711971 ("bpf: Inline calls to bpf_loop when callback is known") Signed-off-by: Matthieu Baerts --- Notes: v2: switch from 'bool' to 'unsigned int' (Yonghong Song) include/linux/bpf_verifier.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index 81b19669efba..2e3bad8640dc 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -345,10 +345,10 @@ struct bpf_verifier_state_list { }; struct bpf_loop_inline_state { - int initialized:1; /* set to true upon first entry */ - int fit_for_inline:1; /* true if callback function is the same - * at each call and flags are always zero - */ + unsigned int initialized:1; /* set to true upon first entry */ + unsigned int fit_for_inline:1; /* true if callback function is the same + * at each call and flags are always zero + */ u32 callback_subprogno; /* valid when fit_for_inline is true */ }; -- 2.36.1