All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext
@ 2022-05-19  6:29 Xiu Jianfeng
  2022-05-21  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Xiu Jianfeng @ 2022-05-19  6:29 UTC (permalink / raw)
  To: vyasevich, nhorman, marcelo.leitner, davem, edumazet, kuba, pabeni
  Cc: linux-sctp, netdev, linux-kernel

Use memset_after() helper to simplify the code, there is no functional
change in this patch.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 net/sctp/stream_sched.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/sctp/stream_sched.c b/net/sctp/stream_sched.c
index 99e5f69fbb74..518b1b9bf89d 100644
--- a/net/sctp/stream_sched.c
+++ b/net/sctp/stream_sched.c
@@ -146,14 +146,11 @@ int sctp_sched_set_sched(struct sctp_association *asoc,
 
 		/* Give the next scheduler a clean slate. */
 		for (i = 0; i < asoc->stream.outcnt; i++) {
-			void *p = SCTP_SO(&asoc->stream, i)->ext;
+			struct sctp_stream_out_ext *ext = SCTP_SO(&asoc->stream, i)->ext;
 
-			if (!p)
+			if (!ext)
 				continue;
-
-			p += offsetofend(struct sctp_stream_out_ext, outq);
-			memset(p, 0, sizeof(struct sctp_stream_out_ext) -
-				     offsetofend(struct sctp_stream_out_ext, outq));
+			memset_after(ext, 0, outq);
 		}
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext
  2022-05-19  6:29 [PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext Xiu Jianfeng
@ 2022-05-21  0:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-21  0:50 UTC (permalink / raw)
  To: Xiu Jianfeng
  Cc: vyasevich, nhorman, marcelo.leitner, davem, edumazet, kuba,
	pabeni, linux-sctp, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 19 May 2022 14:29:32 +0800 you wrote:
> Use memset_after() helper to simplify the code, there is no functional
> change in this patch.
> 
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
> ---
>  net/sctp/stream_sched.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

Here is the summary with links:
  - [-next] stcp: Use memset_after() to zero sctp_stream_out_ext
    https://git.kernel.org/netdev/net-next/c/29849a486a85

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] 2+ messages in thread

end of thread, other threads:[~2022-05-21  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19  6:29 [PATCH -next] stcp: Use memset_after() to zero sctp_stream_out_ext Xiu Jianfeng
2022-05-21  0:50 ` patchwork-bot+netdevbpf

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.