From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [bpf-next:master 33/40] kernel/bpf/verifier.c:12762:17-18: WARNING opportunity for max()
Date: Sun, 13 Sep 2026 16:35:04 +0200 [thread overview]
Message-ID: <202609131635.g284ODRz-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Yonghong Song <yonghong.song@linux.dev>
CC: Alexei Starovoitov <ast@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
head: a41c69c6ea14596cfd95978483166d4eff52435e
commit: 1e6c598b02e72ddd62b4d4e0c05159794b8bddbf [33/40] bpf: Prepare kfunc arguments for the JIT from an ABI description
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: hexagon-randconfig-r062-20260913 (https://download.01.org/0day-ci/archive/20260913/202609131635.g284ODRz-lkp@intel.com/config)
compiler: clang version 21.1.6 (https://github.com/llvm/llvm-project a832a5222e489298337fbb5876f8dcaf072c5cca)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202609131635.g284ODRz-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> kernel/bpf/verifier.c:12762:17-18: WARNING opportunity for max()
vim +12762 kernel/bpf/verifier.c
1e6c598b02e72d Yonghong Song 2026-09-12 12751
1e6c598b02e72d Yonghong Song 2026-09-12 12752 static u32 __btf_func_arg_align(const struct btf *btf, const struct btf_type *t, int rec)
1e6c598b02e72d Yonghong Song 2026-09-12 12753 {
1e6c598b02e72d Yonghong Song 2026-09-12 12754 const struct btf_member *member;
1e6c598b02e72d Yonghong Song 2026-09-12 12755 const struct btf_type *mt;
1e6c598b02e72d Yonghong Song 2026-09-12 12756 u32 align, i;
1e6c598b02e72d Yonghong Song 2026-09-12 12757
1e6c598b02e72d Yonghong Song 2026-09-12 12758 while (btf_type_is_array(t))
1e6c598b02e72d Yonghong Song 2026-09-12 12759 t = btf_type_skip_modifiers(btf, btf_array(t)->type, NULL);
1e6c598b02e72d Yonghong Song 2026-09-12 12760
1e6c598b02e72d Yonghong Song 2026-09-12 12761 if (btf_type_is_int(t))
1e6c598b02e72d Yonghong Song 2026-09-12 @12762 return t->size > BPF_REG_SIZE ? t->size : BPF_REG_SIZE;
1e6c598b02e72d Yonghong Song 2026-09-12 12763 if (!btf_type_is_struct(t))
1e6c598b02e72d Yonghong Song 2026-09-12 12764 return BPF_REG_SIZE;
1e6c598b02e72d Yonghong Song 2026-09-12 12765 if (rec >= BTF_MEMBER_MAX_DEPTH)
1e6c598b02e72d Yonghong Song 2026-09-12 12766 return 0;
1e6c598b02e72d Yonghong Song 2026-09-12 12767
1e6c598b02e72d Yonghong Song 2026-09-12 12768 for_each_member(i, t, member) {
1e6c598b02e72d Yonghong Song 2026-09-12 12769 mt = btf_type_skip_modifiers(btf, member->type, NULL);
1e6c598b02e72d Yonghong Song 2026-09-12 12770 align = __btf_func_arg_align(btf, mt, rec + 1);
1e6c598b02e72d Yonghong Song 2026-09-12 12771 if (!align)
1e6c598b02e72d Yonghong Song 2026-09-12 12772 return 0;
1e6c598b02e72d Yonghong Song 2026-09-12 12773 if (align > BPF_REG_SIZE)
1e6c598b02e72d Yonghong Song 2026-09-12 12774 return 2 * BPF_REG_SIZE;
1e6c598b02e72d Yonghong Song 2026-09-12 12775 }
1e6c598b02e72d Yonghong Song 2026-09-12 12776 return BPF_REG_SIZE;
1e6c598b02e72d Yonghong Song 2026-09-12 12777 }
1e6c598b02e72d Yonghong Song 2026-09-12 12778
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-09-13 14:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202609131635.g284ODRz-lkp@intel.com \
--to=lkp@intel.com \
--cc=julia.lawall@inria.fr \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox