public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
@ 2022-09-27  2:42 Shang XiaoJing
  2022-09-27 18:31 ` philipp hortmann
  0 siblings, 1 reply; 3+ messages in thread
From: Shang XiaoJing @ 2022-09-27  2:42 UTC (permalink / raw)
  To: gregkh, wjsota, linux-staging; +Cc: shangxiaojing

Use skb_put_data() instead of skb_put() and memcpy(), which is shorter
and clear.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
index cd8bbc358d01..57b4c8433e8e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
@@ -61,8 +61,7 @@ bool rtl92e_send_cmd_pkt(struct net_device *dev, u32 type, const void *data,
 			tcb_desc->txbuf_size = frag_length;
 		}
 
-		seg_ptr = skb_put(skb, frag_length);
-		memcpy(seg_ptr, data, (u32)frag_length);
+		skb_put_data(skb, data, frag_length);
 
 		if (type == DESC_PACKET_TYPE_INIT &&
 		    (!priv->rtllib->check_nic_enough_desc(dev, TXCMD_QUEUE) ||
-- 
2.17.1


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

end of thread, other threads:[~2022-09-27 18:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27  2:42 [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair Shang XiaoJing
2022-09-27 18:31 ` philipp hortmann
2022-09-27 18:55   ` Nam Cao

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