netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Lee <tiny.windzz@gmail.com>
To: davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Willem de Bruijn <willemb@google.com>,
	dja@axtens.net, ast@kernel.org, sbrivio@redhat.com,
	pabeni@redhat.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] net: skbuff.h: remove unnecessary unlikely()
Date: Mon, 5 Nov 2018 21:21:50 +0800	[thread overview]
Message-ID: <CAEExFWuGN_R=7B4ueAVA8hVoix8ko8zQSXzHxZB5gjwP7jOjpg@mail.gmail.com> (raw)
In-Reply-To: <20181104131444.4049-1-tiny.windzz@gmail.com>

add netdev@vger.kernel.org
-- Yangtao
On Sun, Nov 4, 2018 at 9:14 PM Yangtao Li <tiny.windzz@gmail.com> wrote:
>
> 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
>

       reply	other threads:[~2018-11-05 13:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181104131444.4049-1-tiny.windzz@gmail.com>
2018-11-05 13:21 ` Frank Lee [this message]
2018-11-05 16:02   ` [PATCH] net: skbuff.h: remove unnecessary unlikely() Frank Lee
2018-11-05 18:09   ` David Miller
2018-11-06 15:45 Yangtao Li
2018-11-06 19:22 ` 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='CAEExFWuGN_R=7B4ueAVA8hVoix8ko8zQSXzHxZB5gjwP7jOjpg@mail.gmail.com' \
    --to=tiny.windzz@gmail.com \
    --cc=ast@kernel.org \
    --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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).