From: Shang XiaoJing <shangxiaojing@huawei.com>
To: <gregkh@linuxfoundation.org>, <wjsota@gmail.com>,
<linux-staging@lists.linux.dev>
Cc: <shangxiaojing@huawei.com>
Subject: [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
Date: Tue, 27 Sep 2022 10:42:20 +0800 [thread overview]
Message-ID: <20220927024220.14044-1-shangxiaojing@huawei.com> (raw)
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
next reply other threads:[~2022-09-27 2:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 2:42 Shang XiaoJing [this message]
2022-09-27 18:31 ` [PATCH -next] staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair philipp hortmann
2022-09-27 18:55 ` Nam Cao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220927024220.14044-1-shangxiaojing@huawei.com \
--to=shangxiaojing@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
--cc=wjsota@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox