lkml.org 
[lkml]   [2009]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] Removed useless retval variables in usb-serial.c
    From
    Date
    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);




    \
     
     \ /
      Last update: 2009-07-24 20:05    [W:0.035 / U:0.060 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site