Re: [RFC] Push BKL into chrdev opens

Kevin O'Connor (kevin@koconnor.net)
Fri, 2 Aug 2002 14:20:46 -0400


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/