Skip to contentSkip to conversation

staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair

PATCH Superseded Shang XiaoJing 3 participants 3 messages Sep 27, 2022 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +1 -2
index cd8bbc358d01..57b4c8433e8e 100644
@@ -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) ||
Signature · 1 line
2.17.1
#1 lore raw
Quoted 25 lines · Shang XiaoJing

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

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +1 -2
index cd8bbc358d01..57b4c8433e8e 100644
@@ -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) ||
Signature · 1 line
2.17.1

Applying: staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
error: patch failed: drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c:61
error: drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c: patch does not apply Patch failed at 0001 staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair

Sorry
Bye Philipp

#2 lore raw
Quoted 31 lines · philipp hortmann
Quoted 25 lines · Shang XiaoJing

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

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c +1 -2
index cd8bbc358d01..57b4c8433e8e 100644
@@ -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) ||
Signature · 1 line
2.17.1

Applying: staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
error: patch failed: drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c:61
error: drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c: patch does not apply Patch failed at 0001 staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair

Quoted 2 lines

Sorry
Bye Philipp

I think this patch has already been applied to staging-testing..

Best regards,
Nam