On 29.08.2024 09:28, Michal Orzel wrote:
> On 29/08/2024 07:55, Jan Beulich wrote:
>> With the original code I observe
>>
>> In function ‘__irq_to_desc’,
>>     inlined from ‘route_irq_to_guest’ at arch/arm/irq.c:465:12:
>> arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of 
>> ‘irq_desc_t[32]’ {aka ‘struct irq_desc[32]’} [-Werror=array-bounds=]
>>    54 |         return &this_cpu(local_irq_desc)[irq];
>>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> which looks pretty bogus: How in the world does the compiler arrive at
>> -2 when compiling route_irq_to_guest()? Yet independent of that the
>> function's parameter wants to be of unsigned type anyway, as shown by
>> a vast majority of callers (others use plain int when they really mean
>> non-negative quantities). With that adjustment the code compiles fine
>> again.
>>
>> Signed-off-by: Jan Beulich <jbeul...@suse.com>
> Acked-by: Michal Orzel <michal.or...@amd.com>

Thanks.

> Are there any places where we still require irq member of irq_desc to be 
> signed?

I can't spot any. On x86 we store negated values, but only in ->arch.irq.

Jan

Reply via email to