Re: [tip:irq/urgent] genirq: Make legacy autoprobing work again
From: Arnd Bergmann
Date: Thu Feb 01 2018 - 06:35:42 EST
On Thu, Feb 1, 2018 at 9:15 AM, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
>> +++ b/kernel/irq/chip.c
>> @@ -294,11 +294,11 @@ int irq_activate(struct irq_desc *desc)
>> return 0;
>> }
>>
>> -void irq_activate_and_startup(struct irq_desc *desc, bool resend)
>> +int irq_activate_and_startup(struct irq_desc *desc, bool resend)
>> {
>> if (WARN_ON(irq_activate(desc)))
>> return;
>
> As reported by 0day, this should return something.
>
> if CONFIG_IRQ_DOMAIN=n or CONFIG_IRQ_DOMAIN_HIERARCHY=n,
> irq_activate() will never return 1, and the code path can be eliminated.
>
> BTW, is gcc becoming too smart, and already eliminating code before it
> generates warnings for it? Recently I've seen some other cases where buggy
> code was not warned about, as it was considered not having any impact.
>
I've tried my collection of compiler versions, and they produce a warning here
on my box.
Arnd