From: Ivan Safonov <insafonov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bhagyashri Dighole <digholebhagyashri@gmail.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
Wentao Cai <etsai042@gmail.com>,
Alexander Duyck <alexander.h.duyck@intel.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Ivan Safonov <insafonov@gmail.com>
Subject: [PATCH] staging: netlogic: replace skb_put/pull pair with skb_reserve
Date: Wed, 20 Mar 2019 15:45:19 +0300 [thread overview]
Message-ID: <20190320124519.15751-1-insafonov@gmail.com> (raw)
The sequence
skb_put(skb);
skb_pull(skb);
leads to the same result as
skb_reserve(skb);
but second is a little shorter and clearer.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
drivers/staging/netlogic/xlr_net.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 10f14a5cf490..1897b711d66d 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -87,8 +87,7 @@ static inline unsigned char *xlr_alloc_skb(void)
if (!skb)
return NULL;
skb_data = skb->data;
- skb_put(skb, MAC_SKB_BACK_PTR_SIZE);
- skb_pull(skb, MAC_SKB_BACK_PTR_SIZE);
+ skb_reserve(skb, MAC_SKB_BACK_PTR_SIZE);
memcpy(skb_data, &skb, buf_len);
return skb->data;
--
2.19.2
reply other threads:[~2019-03-20 12:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190320124519.15751-1-insafonov@gmail.com \
--to=insafonov@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=digholebhagyashri@gmail.com \
--cc=etsai042@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®