mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: netlogic: replace skb_put/pull pair with skb_reserve
@ 2019-03-20 12:45 Ivan Safonov
  0 siblings, 0 replies; only message in thread
From: Ivan Safonov @ 2019-03-20 12:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bhagyashri Dighole, Jeff Kirsher, Wentao Cai, Alexander Duyck,
	devel, linux-kernel, Ivan Safonov

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-20 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 12:45 [PATCH] staging: netlogic: replace skb_put/pull pair with skb_reserve Ivan Safonov

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®