mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Greg KH <gregkh@suse.de>
Cc: Trevor Pace <tr212206@dal.ca>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Removed useless retval variables in usb-serial.c
Date: Fri, 24 Jul 2009 11:02:22 -0700	[thread overview]
Message-ID: <1248458542.3498.52.camel@Joe-Laptop.home> (raw)
In-Reply-To: <20090724173422.GA10989@suse.de>

On Fri, 2009-07-24 at 10:34 -0700, Greg KH wrote:
> On Fri, Jul 24, 2009 at 12:48:03PM -0300, Trevor Pace wrote:
> > Removed useless return value variables.
> They seem useful to me, especially as it causes the code to fall out of
> the function at the bottom, and not in the middle, which makes
> maintaining the code easier to do over time, right?

If paint for the bike shed is still required,
my preferences are:

If unwinding is required, gotos are useful
and the last return should be the error case.

If no unwinding is required, gotos tend to be
distracting and the last return should be the
no error case.

Trevor's new code does:

	if (port->serial->type->ioctl)
		return port->serial->type->ioctl(tty, file, cmd, arg);
	return -ENOIOCTLCMD;

where I would have preferred:

	if (!port->serial->type->ioctl)
		return -ENOIOCTLCMD;

	return port->serial->type->ioctl(tty, file, cmd, arg);



  reply	other threads:[~2009-07-24 18:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 15:48 Trevor Pace
2009-07-24 16:29 ` Sergei Shtylyov
2009-07-24 17:06   ` Trevor Pace
2009-07-24 18:29     ` Greg KH
2009-07-24 16:53 ` Oliver Neukum
2009-07-24 19:16   ` Greg KH
2009-07-24 17:34 ` Greg KH
2009-07-24 18:02   ` Joe Perches [this message]
2009-07-24 18:12     ` Greg KH
     [not found]   ` <bad58e960907241047o7558a715u6a36535f2496c49d@mail.gmail.com>
2009-07-24 19:22     ` Fwd: " Trevor Pace

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=1248458542.3498.52.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tr212206@dal.ca \
    /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

all inboxes | Powered by JetHome®