lkml.org 
[lkml]   [2002]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] Push BKL into chrdev opens
    On Thu, Aug 01, 2002 at 03:22:42AM -0700, Dave Hansen wrote:
    > This patch adds the BKL to each character device's open() function.
    > The BKL will remain in chrdev_open() until the module unload races are
    > fixed, but this makes it unnecessary there for any other reason.
    [...]
    > diff -Nru a/drivers/char/istallion.c b/drivers/char/istallion.c
    > --- a/drivers/char/istallion.c Wed Jul 31 10:25:53 2002
    > +++ b/drivers/char/istallion.c Wed Jul 31 10:25:53 2002
    > @@ -1022,6 +1022,8 @@
    >
    > /*****************************************************************************/
    >
    > +#define returnout(x) ret=x;goto out;
    > +
    > static int stli_open(struct tty_struct *tty, struct file *filp)
    > {
    > stlibrd_t *brdp;
    > @@ -1037,21 +1039,21 @@
    > minordev = minor(tty->device);
    > brdnr = MINOR2BRD(minordev);
    > if (brdnr >= stli_nrbrds)
    > - return(-ENODEV);
    > + returnout(-ENODEV);

    Hi Dave,

    The returnout macro is incredibly ugly. It is also broken. (The "goto
    out" is on the same level as the if and is executed regardless of the if
    condition.)

    -Kevin

    --
    ------------------------------------------------------------------------
    | Kevin O'Connor "BTW, IMHO we need a FAQ for |
    | kevin@koconnor.net 'IMHO', 'FAQ', 'BTW', etc. !" |
    ------------------------------------------------------------------------
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:27    [W:0.021 / U:180.336 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site