netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Sacren <sakiwit@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: sakiwit@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] ipip: do not use 'err' variable for setting return value
Date: Tue, 15 Jan 2013 14:32:31 -0700	[thread overview]
Message-ID: <20130115213231.GB8835@mail.gmail.com> (raw)
In-Reply-To: <20130115.032008.1473140825117157751.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Tue, 15 Jan 2013 03:20:08 -0500
>
> From: Jean Sacren <sakiwit@gmail.com>
> Date: Tue, 15 Jan 2013 01:14:10 -0700
> 
> > It's a bit confusing to set 'err' variable inside and outside of the
> > block for the return value of ipip_err(). We don't even need this
> > variable, so clean it all up to spare declaration as well as bunch of
> > unnecessary initializations and jumps.
> > 
> > Signed-off-by: Jean Sacren <sakiwit@gmail.com>
> 
> It makes the non-error path straight line code.

I thought about the error path, but I realized the error handling code
couldn't be simpler. There is only one error, namely ENOENT, which
warrants no error path. As 'err' variable was used, you were forced to
reset it to zero seven months ago. Again you were forced to reset it to
zero six months ago. As you were doubly forced, finally I came up with
this idea of getting rid of the unnecessary variable.

Also the error handling in the patch is consistent with the way earlier
portion of the function definition does.

> The code as-is is fine, and I'm not applying this patch, sorry.

Thank you for reviewing. This is a rather trivial patch. If patches like
this one are not compelling enough for acceptance, that's fair enough.

-- 
Jean Sacren

      reply	other threads:[~2013-01-15 21:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-15  8:14 [PATCH net-next] ipip: do not use 'err' variable for setting return value Jean Sacren
2013-01-15  8:20 ` David Miller
2013-01-15 21:32   ` Jean Sacren [this message]

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=20130115213231.GB8835@mail.gmail.com \
    --to=sakiwit@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;
as well as URLs for NNTP newsgroup(s).