[PATCH wireless v2] scsi: megaraid: Remove unnecessary memset

Subsystems: atheros ath generic utilities, qualcomm wcn36xx wireless driver, the rest

STALE2084d

2 messages, 2 authors, 2021-01-26 · open the first message on its own page

[PATCH wireless v2] scsi: megaraid: Remove unnecessary memset

From: Zheng Yongjun <hidden>
Date: 2021-01-15 01:46:21

memcpy operation is next to memset code, and the size to copy
is equals to the size to memset, so the memset operation is
unnecessary, remove it.

Signed-off-by: Zheng Yongjun <redacted>
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 273fed22711f..5447a6696c35 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -478,7 +478,6 @@ static void init_hal_msg(struct wcn36xx_hal_msg_header *hdr,
 
 #define PREPARE_HAL_BUF(send_buf, msg_body) \
 	do {							\
-		memset(send_buf, 0, msg_body.header.len);	\
 		memcpy(send_buf, &msg_body, sizeof(msg_body));	\
 	} while (0)						\
 
-- 
2.22.0

Re: [PATCH wireless v2] scsi: megaraid: Remove unnecessary memset

From: Kalle Valo <hidden>
Date: 2021-01-26 06:40:18

Zheng Yongjun [off-list ref] wrote:
memcpy operation is next to memset code, and the size to copy
is equals to the size to memset, so the memset operation is
unnecessary, remove it.

Signed-off-by: Zheng Yongjun <redacted>
Wrong title.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210115014559.7803-1-zhengyongjun3@huawei.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help