[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86802c440808070351m6400b290jb826d10407c7de77@mail.gmail.com>
Date: Thu, 7 Aug 2008 03:51:48 -0700
From: "Yinghai Lu" <yhlu.kernel@...il.com>
To: "Alan Cox" <alan@...rguk.ukuu.org.uk>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
"Ingo Molnar" <mingo@...e.hu>,
"Thomas Gleixner" <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
"Dhaval Giani" <dhaval@...ux.vnet.ibm.com>,
"Mike Travis" <travis@....com>,
"Andrew Morton" <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/33] dyn_array and nr_irqs support v4
On Thu, Aug 7, 2008 at 3:12 AM, Alan Cox <alan@...rguk.ukuu.org.uk> wrote:
> On Wed, 06 Aug 2008 18:02:18 -0700
> ebiederm@...ssion.com (Eric W. Biederman) wrote:
>
>> Alan Cox <alan@...rguk.ukuu.org.uk> writes:
>>
>> > A lot of these are range checks so could be replaced by a single
>> > valid_irq(irq) test.
>>
>> Yes. My first impression was that with NR_IRQS dead valid_irq could
>> easily become. #define valid_irq(irq) ((irq) != 0)
>
> Not really - there are lots of cases where we sanity check an IRQ passed
> from user space or module parameter configuration. So we do actually need
>
> valid_irq(irq) ((irq) > 0 && (irq) < nr_irqs)
>
> [or relevant per arch alternatives]
#ifndef CONFIG_HAVE_SPARSE_IRQ
#define valid_irq(irq) ((irq) > 0 && (irq) < nr_irqs)
#else
#define valid_irq(irq) ((irq) > 0)
anyway why 0 is invalid instead of -1U...?
YH
#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists