Re: [PATCH 4/5] genirq: Use the common function irq_expand_nr_irqs()

From: Thomas Gleixner
Date: Tue Feb 07 2023 - 05:29:45 EST


On Tue, Jan 31 2023 at 10:43, Shanker Donthineni wrote:
> On 1/31/23 03:35, Thomas Gleixner wrote:
>>> +static int irq_expand_nr_irqs(unsigned int nr)
>>> +{
>>> + if (nr > MAX_SPARSE_IRQS)
>>> + return -ENOMEM;
>>> + nr_irqs = nr;
>>> + return 0;
>>> +}
>>
>> or preferrably something like this:
>>
>> if (!IS_ENABLED(CONFIG_SPARSEIRQ) || nr > MAX_SPARSE_IRQS)
>> return -ENOMEM;
>>
>> which makes it entirely clear and also allows the compiler to optimize
>> is down to a 'return -ENOMEM'.
>>
> I'll drop this patch since you're suggesting to remove !SPARSEIRQ support.

Sometime in the future when I analyzed what the implications are. So
just keep it and make it readable.

Thanks,

tglx