projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f058856
)
IB/hfi1: Use skb_put_data() instead of skb_put/memcpy pair
author
Shang XiaoJing
<shangxiaojing@huawei.com>
Tue, 27 Sep 2022 02:29:19 +0000
(10:29 +0800)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Tue, 27 Sep 2022 13:43:10 +0000
(10:43 -0300)
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>
drivers/infiniband/hw/hfi1/ipoib_rx.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/hfi1/ipoib_rx.c
b/drivers/infiniband/hw/hfi1/ipoib_rx.c
index 3afa7545242c4ce2470e026dc000bada35ef6df7..629691a572efe47c7c1eaa7e52c9effcf85ef0db 100644
(file)
--- a/
drivers/infiniband/hw/hfi1/ipoib_rx.c
+++ b/
drivers/infiniband/hw/hfi1/ipoib_rx.c
@@
-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);
}