staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
authorShang XiaoJing <shangxiaojing@huawei.com>
Tue, 27 Sep 2022 02:42:20 +0000 (10:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2022 08:28:17 +0000 (10:28 +0200)
Use skb_put_data() instead of skb_put() and memcpy(), which is shorter
and clear.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Link: https://lore.kernel.org/r/20220927024220.14044-1-shangxiaojing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c

index df6e1043fe19e058e5f509feada1e5edeff738ce..8bf06f736ffb8a0414468a38445bdfc1b5770ef9 100644 (file)
@@ -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) ||