public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Simon Horman <horms@verge.net.au>
Cc: netdev@vger.kernel.org, Dmitry Kozlov <xeb@mail.ru>
Subject: Re: [PATCH] GRE: Use IS_ERR_OR_NULL in gre_gso_segment
Date: Fri, 19 Apr 2013 03:24:33 -0700	[thread overview]
Message-ID: <1366367073.3205.105.camel@edumazet-glaptop> (raw)
In-Reply-To: <1366354120-11230-1-git-send-email-horms@verge.net.au>

On Fri, 2013-04-19 at 15:48 +0900, Simon Horman wrote:
> Signed-off-by: Simon Horman <horms@verge.net.au>
> ---
>  net/ipv4/gre.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
> index d2d5a99..0ae998b 100644
> --- a/net/ipv4/gre.c
> +++ b/net/ipv4/gre.c
> @@ -168,7 +168,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
>  	/* segment inner packet. */
>  	enc_features = skb->dev->hw_enc_features & netif_skb_features(skb);
>  	segs = skb_mac_gso_segment(skb, enc_features);
> -	if (!segs || IS_ERR(segs))
> +	if (IS_ERR_OR_NULL(segs))
>  		goto out;
>  
>  	skb = segs;

Hi Simon

AFAIK I would change things so that NULL is not a possible value.

I don't really like IS_ERR_OR_NULL() because it hides some lazyness of
ours, and is more expensive (2 tests)

If we return NULL for an error, why not instead return -Esomething,
since caller is OK to get -ENOMEM,-Exxxxx,... ?

Anyway I presume this is a net-next patch ?

Thanks

  reply	other threads:[~2013-04-19 10:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  6:48 [PATCH] GRE: Use IS_ERR_OR_NULL in gre_gso_segment Simon Horman
2013-04-19 10:24 ` Eric Dumazet [this message]
2013-04-19 18:28   ` David Miller
2013-04-22  1:35     ` Simon Horman
2013-04-22  1:44       ` David Miller
2013-04-22  2:13         ` Simon Horman
2013-04-23  7:50           ` Simon Horman
2013-04-23 20:47             ` Jesse Gross
2013-04-25  8:46               ` Herbert Xu
2013-04-25  9:01                 ` David Miller
2013-04-25  9:03                   ` Herbert Xu
2013-04-25  9:11                     ` Herbert Xu
2013-04-25 13:58                       ` Eric Dumazet
2013-04-26  3:38                         ` Herbert Xu

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=1366367073.3205.105.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=horms@verge.net.au \
    --cc=netdev@vger.kernel.org \
    --cc=xeb@mail.ru \
    /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