mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
IB/hfi1: 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. Drop the tmp variable that is not needed any more. Link: https://lore.kernel.org/r/20220927022919.16902-1-shangxiaojing@huawei.com Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
This commit is contained in:
parent
f058856797
commit
cbdae01d8b
|
|
@ -11,13 +11,10 @@
|
|||
|
||||
static void copy_ipoib_buf(struct sk_buff *skb, void *data, int size)
|
||||
{
|
||||
void *dst_data;
|
||||
|
||||
skb_checksum_none_assert(skb);
|
||||
skb->protocol = *((__be16 *)data);
|
||||
|
||||
dst_data = skb_put(skb, size);
|
||||
memcpy(dst_data, data, size);
|
||||
skb_put_data(skb, data, size);
|
||||
skb->mac_header = HFI1_IPOIB_PSEUDO_LEN;
|
||||
skb_pull(skb, HFI1_IPOIB_ENCAP_LEN);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user