Message ID | 20220927024344.14352-1-shangxiaojing@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1abf6ab490c518164a3ffb62e4533850aaecb6fd |
Headers | show |
Series | [-next] usb: cdc-wdm: Use skb_put_data() instead of skb_put/memcpy pair | expand |
On 27.09.22 04:43, Shang XiaoJing wrote: > Use skb_put_data() instead of skb_put() and memcpy(), which is clear. > > Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Acked-by: Oliver Neukum <oneukum@suse.com>
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index eebe782380fb..1f0951be15ab 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -958,7 +958,7 @@ static void wdm_wwan_rx(struct wdm_device *desc, int length) if (!skb) return; - memcpy(skb_put(skb, length), desc->inbuf, length); + skb_put_data(skb, desc->inbuf, length); wwan_port_rx(port, skb); /* inbuf has been copied, it is safe to check for outstanding data */
Use skb_put_data() instead of skb_put() and memcpy(), which is clear. Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)