Netdev List
 help / color / mirror / Atom feed
* [PATCH] mctp: serial: replace memset with zero-initialization
@ 2026-05-30 17:56 Manish Baing
  2026-05-30 21:41 ` kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: Manish Baing @ 2026-05-30 17:56 UTC (permalink / raw)
  To: jk, matt
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel, manishbaing2789

Use empty brace initialization (= {}) instead of explicit memset()
to zero-initialize stack memory to simplify the code.

No functional change.

Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
---
 drivers/net/mctp/mctp-serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mctp/mctp-serial.c b/drivers/net/mctp/mctp-serial.c
index 26c9a33fd636..c97ebd1af356 100644
--- a/drivers/net/mctp/mctp-serial.c
+++ b/drivers/net/mctp/mctp-serial.c
@@ -537,12 +537,12 @@ struct test_chunk_tx {
 static void test_next_chunk_len(struct kunit *test)
 {
 	struct mctp_serial devx;
+	struct mctp_serial devx = { };
 	struct mctp_serial *dev = &devx;
 	int next;
 
 	const struct test_chunk_tx *params = test->param_value;
 
-	memset(dev, 0x0, sizeof(*dev));
 	memcpy(dev->txbuf, params->input, params->input_len);
 	dev->txlen = params->input_len;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-05-30 21:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30 17:56 [PATCH] mctp: serial: replace memset with zero-initialization Manish Baing
2026-05-30 21:41 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox