* [PATCH] bpf, devmap: Remove unnecessary if check in for loop
@ 2024-05-29 10:19 Thorsten Blum
2024-05-29 11:39 ` Jiri Olsa
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Thorsten Blum @ 2024-05-29 10:19 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa
Cc: netdev, bpf, linux-kernel, Thorsten Blum
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf, devmap: Remove unnecessary if check in for loop
2024-05-29 10:19 [PATCH] bpf, devmap: Remove unnecessary if check in for loop Thorsten Blum
@ 2024-05-29 11:39 ` Jiri Olsa
2024-05-29 14:24 ` Toke Høiland-Jørgensen
2024-06-03 15:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2024-05-29 11:39 UTC (permalink / raw)
To: Thorsten Blum
Cc: Alexei Starovoitov, Daniel Borkmann, David S. Miller,
Jakub Kicinski, Jesper Dangaard Brouer, John Fastabend,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, netdev, bpf,
linux-kernel
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf, devmap: Remove unnecessary if check in for loop
2024-05-29 10:19 [PATCH] bpf, devmap: Remove unnecessary if check in for loop Thorsten Blum
2024-05-29 11:39 ` Jiri Olsa
@ 2024-05-29 14:24 ` Toke Høiland-Jørgensen
2024-06-03 15:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Toke Høiland-Jørgensen @ 2024-05-29 14:24 UTC (permalink / raw)
To: Thorsten Blum, Alexei Starovoitov, Daniel Borkmann,
David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
John Fastabend, Andrii Nakryiko, Martin KaFai Lau,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa
Cc: netdev, bpf, linux-kernel, Thorsten Blum
Thorsten Blum <thorsten.blum@toblux.com> writes:
> 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>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpf, devmap: Remove unnecessary if check in for loop
2024-05-29 10:19 [PATCH] bpf, devmap: Remove unnecessary if check in for loop Thorsten Blum
2024-05-29 11:39 ` Jiri Olsa
2024-05-29 14:24 ` Toke Høiland-Jørgensen
@ 2024-06-03 15:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-03 15:10 UTC (permalink / raw)
To: Thorsten Blum
Cc: ast, daniel, davem, kuba, hawk, john.fastabend, andrii,
martin.lau, eddyz87, song, yonghong.song, kpsingh, sdf, haoluo,
jolsa, netdev, bpf, linux-kernel
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Wed, 29 May 2024 12:19:01 +0200 you 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
>
> [...]
Here is the summary with links:
- bpf, devmap: Remove unnecessary if check in for loop
https://git.kernel.org/bpf/bpf/c/2317dc2c22cc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-03 15:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-29 10:19 [PATCH] bpf, devmap: Remove unnecessary if check in for loop Thorsten Blum
2024-05-29 11:39 ` Jiri Olsa
2024-05-29 14:24 ` Toke Høiland-Jørgensen
2024-06-03 15:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).