Thread (2 messages) 2 messages, 2 authors, 2026-05-30
COLD35d

[PATCH] mctp: serial: replace memset with zero-initialization

From: Manish Baing <hidden>
Date: 2026-05-30 17:56:28
Also in: lkml
Subsystem: management component transport protocol (mctp), networking drivers, the rest · Maintainers: Jeremy Kerr, Matt Johnston, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help