* [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
@ 2022-09-27 2:42 Shang XiaoJing
2022-09-27 18:31 ` philipp hortmann
0 siblings, 1 reply; 3+ messages in thread
From: Shang XiaoJing @ 2022-09-27 2:42 UTC (permalink / raw)
To: gregkh, wjsota, linux-staging; +Cc: shangxiaojing
Use skb_put_data() instead of skb_put() and memcpy(), which is shorter
and clear.
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
index cd8bbc358d01..57b4c8433e8e 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
@@ -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) ||
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
2022-09-27 2:42 [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair Shang XiaoJing
@ 2022-09-27 18:31 ` philipp hortmann
2022-09-27 18:55 ` Nam Cao
0 siblings, 1 reply; 3+ messages in thread
From: philipp hortmann @ 2022-09-27 18:31 UTC (permalink / raw)
To: Shang XiaoJing; +Cc: gregkh, wjsota, linux-staging
Tue, Sep 27, 2022 at 10:42:20AM +0800, Shang XiaoJing wrote:
> Use skb_put_data() instead of skb_put() and memcpy(), which is shorter
> and clear.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
> drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> index cd8bbc358d01..57b4c8433e8e 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> @@ -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) ||
> --
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
2022-09-27 18:31 ` philipp hortmann
@ 2022-09-27 18:55 ` Nam Cao
0 siblings, 0 replies; 3+ messages in thread
From: Nam Cao @ 2022-09-27 18:55 UTC (permalink / raw)
To: philipp hortmann; +Cc: Shang XiaoJing, gregkh, wjsota, linux-staging
On Tue, Sep 27, 2022 at 08:31:10PM +0200, philipp hortmann wrote:
> Tue, Sep 27, 2022 at 10:42:20AM +0800, Shang XiaoJing wrote:
> > Use skb_put_data() instead of skb_put() and memcpy(), which is shorter
> > and clear.
> >
> > Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> > ---
> > drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> > index cd8bbc358d01..57b4c8433e8e 100644
> > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_cmdpkt.c
> > @@ -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) ||
> > --
> > 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
I think this patch has already been applied to staging-testing..
Best regards,
Nam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-27 18:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27 2:42 [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair Shang XiaoJing
2022-09-27 18:31 ` philipp hortmann
2022-09-27 18:55 ` Nam Cao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox