From: Yangtao Li <tiny.windzz@gmail.com>
To: davem@davemloft.net, edumazet@google.com, dja@axtens.net,
willemb@google.com, ast@kernel.org, sbrivio@redhat.com,
posk@google.com, pabeni@redhat.com, borisp@mellanox.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Yangtao Li <tiny.windzz@gmail.com>
Subject: [PATCH] net: skbuff.h: remove unnecessary unlikely()
Date: Tue, 6 Nov 2018 10:45:36 -0500 [thread overview]
Message-ID: <20181106154536.8789-1-tiny.windzz@gmail.com> (raw)
WARN_ON() already contains an unlikely(), so it's not necessary to use
unlikely.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
---
include/linux/skbuff.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 0ba687454267..7dcfb5591dc3 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2508,10 +2508,8 @@ int ___pskb_trim(struct sk_buff *skb, unsigned int len);
static inline void __skb_set_length(struct sk_buff *skb, unsigned int len)
{
- if (unlikely(skb_is_nonlinear(skb))) {
- WARN_ON(1);
+ if (WARN_ON(skb_is_nonlinear(skb)))
return;
- }
skb->len = len;
skb_set_tail_pointer(skb, len);
}
--
2.17.0
next reply other threads:[~2018-11-06 15:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 15:45 Yangtao Li [this message]
2018-11-06 19:22 ` [PATCH] net: skbuff.h: remove unnecessary unlikely() David Miller
-- strict thread matches above, loose matches on Subject: below --
2018-11-04 13:14 Yangtao Li
2018-11-05 0:51 ` David Miller
2018-11-05 13:21 ` Frank Lee
2018-11-05 16:02 ` Frank Lee
2018-11-05 18:09 ` David Miller
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=20181106154536.8789-1-tiny.windzz@gmail.com \
--to=tiny.windzz@gmail.com \
--cc=ast@kernel.org \
--cc=borisp@mellanox.com \
--cc=davem@davemloft.net \
--cc=dja@axtens.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=posk@google.com \
--cc=sbrivio@redhat.com \
--cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.