Skip to contentSkip to conversation

e1000/e1000_ethtool.c: Remove unnecessary usages of memset

PATCH In review Suraj Upadhyay 2 participants 2 messages Jul 14, 2020 – Jul 28, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 e1000/e1000_ethtool.c: Remove unnecessary usages of memset

Replace memsets of 1 byte with simple assignments. Issue reported by checkpatch.pl.

---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_ethtool.c +2 -2
index 0b4196d2cdd4..f976e9daa3d8 100644
@@ -1356,8 +1356,8 @@ static void e1000_create_lbtest_frame(struct sk_buff *skb,
 	memset(skb->data, 0xFF, frame_size);
 	frame_size &= ~1;
 	memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
-	memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
-	memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
+	skb->data[frame_size / 2 + 10] = 0xBE;
+	skb->data[frame_size / 2 + 12] = 0xAF;
 }
 
 static int e1000_check_lbtest_frame(const unsigned char *data,
Signature · 9 lines
2.17.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20200715/8bf0e2df/attachment.asc>
Tested-by on v1 1/4
#1 lore raw
Quoted 9 lines

From: Suraj Upadhyay <[email protected]>
Sent: Tuesday, July 14, 2020 12:41 PM
To: Kirsher, Jeffrey T <[email protected]>; davem at davemloft.net; kuba at kernel.org
Cc: intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux- kernel at vger.kernel.org; kernel-janitors at vger.kernel.org
Subject: [PATCH 1/4] e1000/e1000_ethtool.c: Remove unnecessary usages of memset

Quoted 8 lines

Replace memsets of 1 byte with simple assignments. Issue reported by checkpatch.pl.

---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)