From: Jiri Olsa <olsajiri@gmail.com>
To: Thorsten Blum <thorsten.blum@toblux.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpf, devmap: Remove unnecessary if check in for loop
Date: Wed, 29 May 2024 13:39:10 +0200 [thread overview]
Message-ID: <ZlcT3kSfblBDiaTi@krava> (raw)
In-Reply-To: <20240529101900.103913-2-thorsten.blum@toblux.com>
On Wed, May 29, 2024 at 12:19:01PM +0200, Thorsten Blum wrote:
> The iterator variable dst cannot be NULL and the if check can be
> removed.
>
> Remove it and fix the following Coccinelle/coccicheck warning reported
> by itnull.cocci:
>
> ERROR: iterator variable bound on line 762 cannot be NULL
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
> ---
> kernel/bpf/devmap.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
> index 4e2cdbb5629f..7f3b34452243 100644
> --- a/kernel/bpf/devmap.c
> +++ b/kernel/bpf/devmap.c
> @@ -760,9 +760,6 @@ int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb,
> for (i = 0; i < dtab->n_buckets; i++) {
> head = dev_map_index_hash(dtab, i);
> hlist_for_each_entry_safe(dst, next, head, index_hlist) {
> - if (!dst)
> - continue;
> -
> if (is_ifindex_excluded(excluded_devices, num_excluded,
> dst->dev->ifindex))
> continue;
> --
> 2.45.1
>
next prev parent reply other threads:[~2024-05-29 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 10:19 [PATCH] bpf, devmap: Remove unnecessary if check in for loop Thorsten Blum
2024-05-29 11:39 ` Jiri Olsa [this message]
2024-05-29 14:24 ` Toke Høiland-Jørgensen
2024-06-03 15:10 ` patchwork-bot+netdevbpf
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=ZlcT3kSfblBDiaTi@krava \
--to=olsajiri@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=thorsten.blum@toblux.com \
--cc=yonghong.song@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 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.