* [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy()
@ 2025-08-11 16:40 Thorsten Blum
2025-08-11 23:50 ` Joe Damato
2025-08-13 0:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2025-08-11 16:40 UTC (permalink / raw)
To: Jamal Hadi Salim, Cong Wang, Jiri Pirko, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman
Cc: Thorsten Blum, netdev, linux-kernel
The call to nla_strscpy() already zero-pads the tail of the destination
buffer which makes the additional memset(0) call redundant. Remove it.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
net/sched/act_simple.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
index f3abe0545989..8e69a919b4fe 100644
--- a/net/sched/act_simple.c
+++ b/net/sched/act_simple.c
@@ -72,7 +72,6 @@ static int reset_policy(struct tc_action *a, const struct nlattr *defdata,
d = to_defact(a);
spin_lock_bh(&d->tcf_lock);
goto_ch = tcf_action_set_ctrlact(a, p->action, goto_ch);
- memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
spin_unlock_bh(&d->tcf_lock);
if (goto_ch)
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy()
2025-08-11 16:40 [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy() Thorsten Blum
@ 2025-08-11 23:50 ` Joe Damato
2025-08-13 0:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Joe Damato @ 2025-08-11 23:50 UTC (permalink / raw)
To: Thorsten Blum
Cc: Jamal Hadi Salim, Cong Wang, Jiri Pirko, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev,
linux-kernel
On Mon, Aug 11, 2025 at 06:40:38PM +0200, Thorsten Blum wrote:
> The call to nla_strscpy() already zero-pads the tail of the destination
> buffer which makes the additional memset(0) call redundant. Remove it.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> net/sched/act_simple.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c
> index f3abe0545989..8e69a919b4fe 100644
> --- a/net/sched/act_simple.c
> +++ b/net/sched/act_simple.c
> @@ -72,7 +72,6 @@ static int reset_policy(struct tc_action *a, const struct nlattr *defdata,
> d = to_defact(a);
> spin_lock_bh(&d->tcf_lock);
> goto_ch = tcf_action_set_ctrlact(a, p->action, goto_ch);
> - memset(d->tcfd_defdata, 0, SIMP_MAX_DATA);
> nla_strscpy(d->tcfd_defdata, defdata, SIMP_MAX_DATA);
> spin_unlock_bh(&d->tcf_lock);
> if (goto_ch)
Reviewed-by: Joe Damato <joe@dama.to>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy()
2025-08-11 16:40 [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy() Thorsten Blum
2025-08-11 23:50 ` Joe Damato
@ 2025-08-13 0:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-08-13 0:20 UTC (permalink / raw)
To: Thorsten Blum
Cc: jhs, xiyou.wangcong, jiri, davem, edumazet, kuba, pabeni, horms,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 11 Aug 2025 18:40:38 +0200 you wrote:
> The call to nla_strscpy() already zero-pads the tail of the destination
> buffer which makes the additional memset(0) call redundant. Remove it.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> net/sched/act_simple.c | 1 -
> 1 file changed, 1 deletion(-)
Here is the summary with links:
- [net-next] net/sched: Remove redundant memset(0) call in reset_policy()
https://git.kernel.org/netdev/net-next/c/b3ba7d929ce1
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] 3+ messages in thread
end of thread, other threads:[~2025-08-13 0:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11 16:40 [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy() Thorsten Blum
2025-08-11 23:50 ` Joe Damato
2025-08-13 0:20 ` 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).