Use skb_put_data() instead of skb_put() and memcpy(), which is shorter and clear. Signed-off-by: Shang XiaoJing <shangxiaojing@xxxxxxxxxx> --- 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