bpf: Fix 'dubious one-bit signed bitfield' warnings

ANBZ: #7670

commit f16214c102 upstream.

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: 1ade237119 ("bpf: Inline calls to bpf_loop when callback is known")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20220711081200.2081262-1-matthieu.baerts@tessares.net
Signed-off-by: Tianchen Ding <dtcccc@linux.alibaba.com>
Reviewed-by: Qiao Ma <mqaio@linux.alibaba.com>
Reviewed-by: Yuanhe Shu <xiangzao@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/2547
This commit is contained in:
Matthieu Baerts 2022-07-11 10:12:00 +02:00 committed by 小龙
parent 10f8c825e5
commit a69569b513
1 changed files with 4 additions and 4 deletions

View File

@ -317,10 +317,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 */
};