From: Joe Damato <joe@dama.to>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net/sched: Remove redundant memset(0) call in reset_policy()
Date: Mon, 11 Aug 2025 16:50:52 -0700 [thread overview]
Message-ID: <aJqB3A8LMcocbfRT@MacBook-Air.local> (raw)
In-Reply-To: <20250811164039.43250-1-thorsten.blum@linux.dev>
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>
next prev parent reply other threads:[~2025-08-11 23:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2025-08-13 0:20 ` 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=aJqB3A8LMcocbfRT@MacBook-Air.local \
--to=joe@dama.to \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=thorsten.blum@linux.dev \
--cc=xiyou.wangcong@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).