From 280f669ba63aa20082ffc7daa8fade8e738c944e Mon Sep 17 00:00:00 2001 From: Shang XiaoJing Date: Tue, 27 Sep 2022 10:42:20 +0800 Subject: [PATCH] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Signed-off-by: Shang XiaoJing Link: https://lore.kernel.org/r/20220927024220.14044-1-shangxiaojing@huawei.com Signed-off-by: Greg Kroah-Hartman --- 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 df6e1043fe19..8bf06f736ffb 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c @@ -59,8 +59,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) ||