Re: use of preempt_count instead of in_atomic() at leds-gpio.c

From: Andrew Morton
Date: Fri Mar 21 2008 - 13:38:36 EST


On Fri, 21 Mar 2008 10:53:11 +0100 Jean Delvare <khali@xxxxxxxxxxxx> wrote:

> On Thu, 20 Mar 2008 20:17:23 -0700, Andrew Morton wrote:
> > in_atomic() is for core kernel use only. (...)
>
> Then why is it made available to drivers through <linux/hardirq.h>?

Because we suck.

> If
> it's such a dangerous macro to call from drivers, it shouldn't be made
> available, or at the very least there should be a big fat warning in
> <linux/hardirq.h> that drivers aren't supposed to use it. This would
> have avoided the 23 uses cases in drivers we have right now.

True.
--
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/