From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] bpf: fix itnull.cocci warnings
Date: Tue, 12 Jan 2021 05:56:17 +0800 [thread overview]
Message-ID: <20210111215617.GA38798@fd8e3aebcf75> (raw)
In-Reply-To: <202101120529.xXBTJbWt-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <1610386373-24162-2-git-send-email-alan.maguire@oracle.com>
References: <1610386373-24162-2-git-send-email-alan.maguire@oracle.com>
TO: Alan Maguire <alan.maguire@oracle.com>
From: kernel test robot <lkp@intel.com>
kernel/bpf/btf_show_common.c:1111:6-7: ERROR: iterator variable bound on line 1109 cannot be NULL
Many iterators have the property that the first argument is always bound
to a real list element, never NULL.
Semantic patch information:
False positives arise for some iterators that do not have this property,
or in cases when the loop cursor is reassigned. The latter should only
happen when the matched code is on the way to a loop exit (break, goto,
or return).
Generated by: scripts/coccinelle/iterators/itnull.cocci
CC: Alan Maguire <alan.maguire@oracle.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
url: https://github.com/0day-ci/linux/commits/Alan-Maguire/bpf-libbpf-share-BTF-data-show-functionality/20210112-013917
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
Please take the patch only if it's a positive warning. Thanks!
btf_show_common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/kernel/bpf/btf_show_common.c
+++ b/kernel/bpf/btf_show_common.c
@@ -1108,8 +1108,7 @@ void btf_datasec_show(const struct btf *
__btf_name_by_offset(btf, t->name_off));
for_each_vsi(i, t, vsi) {
var = btf_type_by_id(btf, vsi->type);
- if (i)
- btf_show(show, ",");
+ btf_show(show, ",");
btf_type_ops_show(btf, var, vsi->type,
data + vsi->offset, bits_offset, show);
}
prev parent reply other threads:[~2021-01-11 21:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-11 21:56 [RFC PATCH bpf-next 1/2] bpf: share BTF "show" implementation between kernel and libbpf kernel test robot
2021-01-11 21:56 ` kernel test robot [this message]
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=20210111215617.GA38798@fd8e3aebcf75 \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.