From: Eric Dumazet <eric.dumazet@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH net-next] net: small skb_segment() cleanup
Date: Fri, 17 May 2013 10:13:24 -0700 [thread overview]
Message-ID: <1368810804.3301.100.camel@edumazet-glaptop> (raw)
From: Eric Dumazet <edumazet@google.com>
if (cond) {
...
__skb_put(nskb, doffset);
} else {
...
__skb_put(nskb, doffset);
}
can be simplified to
if (cond) {
...
} else {
...
}
__skb_put(nskb, doffset);
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
net/core/skbuff.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index af9185d..87b5814 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2817,7 +2817,6 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
nskb->truesize += skb_end_offset(nskb) - hsize;
skb_release_head_state(nskb);
- __skb_push(nskb, doffset);
} else {
nskb = __alloc_skb(hsize + doffset + headroom,
GFP_ATOMIC, skb_alloc_rx_flag(skb),
@@ -2827,8 +2826,8 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
goto err;
skb_reserve(nskb, headroom);
- __skb_put(nskb, doffset);
}
+ __skb_put(nskb, doffset);
if (segs)
tail->next = nskb;
next reply other threads:[~2013-05-17 17:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 17:13 Eric Dumazet [this message]
2013-05-17 17:20 ` [PATCH net-next] net: small skb_segment() cleanup Harvey Harrison
2013-05-17 17:27 ` Eric Dumazet
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=1368810804.3301.100.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@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