[PATCH] arm: GIC: Do not try to register more then NR_IRQS interrupts

Pawel Moll Pawel.Moll at arm.com
Tue Nov 23 14:41:02 EST 2010


> > +   WARN_ON(max_irq > NR_IRQS);
> > +   max_irq = min(max_irq, NR_IRQS);
> Maybe make this
>       if (WARN_ON(max_irq > NR_IRQS))
>               max_irq = NR_IRQS;

Fine by me :-)

> First (judging from the name) max_irq is used as irq number, while
> NR_IRQS must not be used as such (i.e. NR_IRQS - 1 is the last valid
> number).  But maybe the variable is just (IMHO) bad.

Yeah, the "max_irq" is actually "gic_irqs" rather than anything else.

> >      * Setup the Linux IRQ subsystem.
> >      */
> >     for (i = irq_start; i < gic_data[gic_nr].irq_offset + max_irq;
> i++) {
> And further shouldn't gic_data[gic_nr].irq_offset be taken into account
> when limiting max_irq?

That's what happens if you try to make as little changes as possible ;-) I should have Done It Right (TM) immediately. A patch follows.

Cheers!

Paweł

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.


More information about the linux-arm-kernel mailing list