linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guillaume Nault <g.nault@alphalink.fr>
To: walter harms <wharms@bfs.de>
Cc: netdev@vger.kernel.org, linux-ppp@vger.kernel.org,
	Paul Mackerras <paulus@samba.org>,
	David Miller <davem@davemloft.net>
Subject: Re: [RFC PATCH 6/6] ppp: add rtnetlink device creation support
Date: Tue, 05 Apr 2016 21:22:22 +0000	[thread overview]
Message-ID: <20160405212222.GD1305@alphalink.fr> (raw)
In-Reply-To: <5703F356.6050107@bfs.de>

On Tue, Apr 05, 2016 at 07:18:14PM +0200, walter harms wrote:
> 
> 
> Am 05.04.2016 02:56, schrieb Guillaume Nault:
> > @@ -1043,12 +1048,39 @@ static int ppp_dev_configure(struct net *src_net, struct net_device *dev,
> >  			     const struct ppp_config *conf)
> >  {
> >  	struct ppp *ppp = netdev_priv(dev);
> > +	struct file *file;
> >  	int indx;
> > +	int err;
> > +
> > +	if (conf->fd < 0) {
> > +		file = conf->file;
> > +		if (!file) {
> > +			err = -EBADF;
> > +			goto out;
> 
> why not just return -EBADF;
> 
> > +		}
> > +	} else {
> > +		file = fget(conf->fd);
> > +		if (!file) {
> > +			err = -EBADF;
> > +			goto out;
> 	
> why not just return -EBADF;
> 
Just because the 'out' label is declared anyway and because this
centralises the return point. But I agree returning -EBADF directly
could be more readable. I don't have strong opinion.

  reply	other threads:[~2016-04-05 21:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05  0:56 [RFC PATCH 0/6] ppp: add rtnetlink support Guillaume Nault
2016-04-05  0:56 ` [RFC PATCH 1/6] ppp: simplify usage of ppp_create_interface() Guillaume Nault
2016-04-05  0:56 ` [RFC PATCH 2/6] ppp: don't hold ppp_mutex before calling ppp_unattached_ioctl() Guillaume Nault
2016-04-05  0:56 ` [RFC PATCH 3/6] ppp: don't lock ppp_mutex while handling PPPIOCDETACH Guillaume Nault
2016-04-05  0:56 ` [RFC PATCH 4/6] ppp: invert lock ordering between ppp_mutex and rtnl_lock Guillaume Nault
2016-04-05  0:56 ` [RFC PATCH 5/6] ppp: define reusable device creation functions Guillaume Nault
2016-04-05 15:28   ` Stephen Hemminger
2016-04-05 21:14     ` Guillaume Nault
2016-04-06  0:30       ` Stephen Hemminger
2016-04-05  0:56 ` [RFC PATCH 6/6] ppp: add rtnetlink device creation support Guillaume Nault
2016-04-05 17:18   ` walter harms
2016-04-05 21:22     ` Guillaume Nault [this message]
2016-04-06  8:02       ` walter harms
2016-04-06  8:21         ` Guillaume Nault
2016-04-05 15:27 ` [RFC PATCH 0/6] ppp: add rtnetlink support Stephen Hemminger
2016-04-05 21:05   ` Guillaume Nault

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=20160405212222.GD1305@alphalink.fr \
    --to=g.nault@alphalink.fr \
    --cc=davem@davemloft.net \
    --cc=linux-ppp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=wharms@bfs.de \
    /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).