lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1248458542.3498.52.camel@Joe-Laptop.home>
Date:	Fri, 24 Jul 2009 11:02:22 -0700
From:	Joe Perches <joe@...ches.com>
To:	Greg KH <gregkh@...e.de>
Cc:	Trevor Pace <tr212206@....ca>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Removed useless retval variables in usb-serial.c

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);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ