[RFC PATCH v2] preliminary support for sparse IRQ

Eric Miao eric.y.miao at gmail.com
Wed May 19 02:53:43 EDT 2010


>>
>> -     if (i < NR_IRQS) {
>> -             raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
>> -             action = irq_desc[i].action;
>> +     if (i < nr_irqs) {
>> +             desc = irq_to_desc(i);
>> +             raw_spin_lock_irqsave(&desc->lock, flags);
>> +             action = desc->action;
>
> Possibly stupid question, but shouldn't you asign 'desc' after locking ?
>

Locking is actually performed on desc->lock, that's why it needs desc to
be first assigned.



More information about the linux-arm-kernel mailing list