Re: [PATCH v3 2/2] x86/apic: Replace common tools with new ones

From: Andy Shevchenko
Date: Fri Feb 23 2018 - 07:40:33 EST


On Fri, Feb 23, 2018 at 9:54 AM, Dou Liyang <douly.fnst@xxxxxxxxxxxxxx> wrote:
> The pending interrupt check code is old, update the following code.
>
> -Replace for() with for_each_set_bit()

> - for (j = 31; j >= 0; j--) {
> - if (value & (1<<j)) {
> + for_each_set_bit(j, &value, 32) {

for_each_set_bit(), mind 'set' part, is equivalent to for-if pair...

> + if (j) {

...here you just exclude bit 0 from consideration by unknown reason.

> ack_APIC_irq();
> acked++;
> }
> }

--
With Best Regards,
Andy Shevchenko