* [PATCH -next] wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair
@ 2022-09-27 2:45 Shang XiaoJing
2022-09-29 8:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Shang XiaoJing @ 2022-09-27 2:45 UTC (permalink / raw)
To: loic.poulain, ryazanov.s.a, johannes, davem, edumazet, kuba,
pabeni, netdev
Cc: shangxiaojing
Use skb_put_data() instead of skb_put() and memcpy(), which is clear.
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei•com>
---
drivers/net/wwan/wwan_hwsim.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wwan/wwan_hwsim.c b/drivers/net/wwan/wwan_hwsim.c
index fad642f9ffd8..ff09a8cedf93 100644
--- a/drivers/net/wwan/wwan_hwsim.c
+++ b/drivers/net/wwan/wwan_hwsim.c
@@ -157,8 +157,8 @@ static int wwan_hwsim_port_tx(struct wwan_port *wport, struct sk_buff *in)
if ((i + 1) < in->len && in->data[i + 1] == '\n')
i++;
n = i - s + 1;
- memcpy(skb_put(out, n), &in->data[s], n);/* Echo */
- memcpy(skb_put(out, 6), "\r\nOK\r\n", 6);
+ skb_put_data(out, &in->data[s], n);/* Echo */
+ skb_put_data(out, "\r\nOK\r\n", 6);
s = i + 1;
port->pstate = AT_PARSER_WAIT_A;
} else if (port->pstate == AT_PARSER_SKIP_LINE) {
@@ -171,7 +171,7 @@ static int wwan_hwsim_port_tx(struct wwan_port *wport, struct sk_buff *in)
if (i > s) {
/* Echo the processed portion of a not yet completed command */
n = i - s;
- memcpy(skb_put(out, n), &in->data[s], n);
+ skb_put_data(out, &in->data[s], n);
}
consume_skb(in);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair
2022-09-27 2:45 [PATCH -next] wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair Shang XiaoJing
@ 2022-09-29 8:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-29 8:00 UTC (permalink / raw)
To: Shang XiaoJing
Cc: loic.poulain, ryazanov.s.a, johannes, davem, edumazet, kuba,
pabeni, netdev
Hello:
This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat•com>:
On Tue, 27 Sep 2022 10:45:11 +0800 you wrote:
> Use skb_put_data() instead of skb_put() and memcpy(), which is clear.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei•com>
> ---
> drivers/net/wwan/wwan_hwsim.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Here is the summary with links:
- [-next] wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair
https://git.kernel.org/netdev/net-next/c/6db239f01abc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-29 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27 2:45 [PATCH -next] wwan_hwsim: Use skb_put_data() instead of skb_put/memcpy pair Shang XiaoJing
2022-09-29 8:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox