staging: r8188eu: use skb_put_data instead of skb_put/memcpy pair
skb_put_data is shorter and clear. Signed-off-by: Ivan Safonov <insafonov@gmail.com> Link: https://lore.kernel.org/r/20190901195301.GA16043@alpha Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f08ab0abb6
commit
39a4916b19
|
@ -1373,11 +1373,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter,
|
|||
/* append to first fragment frame's tail (if privacy frame, pull the ICV) */
|
||||
skb_trim(prframe->pkt, prframe->pkt->len - prframe->attrib.icv_len);
|
||||
|
||||
/* memcpy */
|
||||
memcpy(skb_tail_pointer(prframe->pkt), pnfhdr->pkt->data,
|
||||
pnfhdr->pkt->len);
|
||||
|
||||
skb_put(prframe->pkt, pnfhdr->pkt->len);
|
||||
skb_put_data(prframe->pkt, pnfhdr->pkt->data, pnfhdr->pkt->len);
|
||||
|
||||
prframe->attrib.icv_len = pnfhdr->attrib.icv_len;
|
||||
plist = plist->next;
|
||||
|
|
|
@ -122,8 +122,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
|||
precvframe->pkt = pkt_copy;
|
||||
skb_reserve(pkt_copy, 8 - ((size_t)(pkt_copy->data) & 7));/* force pkt_copy->data at 8-byte alignment address */
|
||||
skb_reserve(pkt_copy, shift_sz);/* force ip_hdr at 8-byte alignment address according to shift_sz. */
|
||||
memcpy(pkt_copy->data, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
|
||||
skb_put(precvframe->pkt, skb_len);
|
||||
skb_put_data(pkt_copy, (pbuf + pattrib->drvinfo_sz + RXDESC_SIZE), skb_len);
|
||||
} else {
|
||||
DBG_88E("%s: alloc_skb fail , drop frag frame\n",
|
||||
__func__);
|
||||
|
|
Loading…
Reference in New Issue