Re: [PATCH] Removed useless retval variables in usb-serial.c

From: Greg KH
Date: Fri Jul 24 2009 - 14:30:53 EST


On Fri, Jul 24, 2009 at 02:06:16PM -0300, Trevor Pace wrote:
> int usb_serial_resume(struct usb_interface *intf)
> {
> struct usb_serial *serial = usb_get_intfdata(intf);
> - int rv;
>
> serial->suspending = 0;
> - if (serial->type->resume)
> - rv = serial->type->resume(serial);
> - else
> - rv = usb_serial_generic_resume(serial);
>
> - return rv;
> + return (serial->type->resume)
> + ? serial->type->resume(serial)
> + : usb_serial_generic_resume(serial);

Sorry, but no, I'm not going to take something like this.

The first version is just so much more readable, and easier to
understand, which is the main point. We want and need code to be easy
to read and understand at a very quick glance. This change only makes
it harder to do so.

thanks,

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