Re: [PATCH 1/7] irqchip/loongarch-avec: Adjust irqchip driver for 32BIT/64BIT
From: Thomas Gleixner
Date: Fri Jan 09 2026 - 15:37:48 EST
On Fri, Jan 09 2026 at 12:23, Jiaxun Yang wrote:
> On Fri, 9 Jan 2026, at 12:09 PM, Thomas Gleixner wrote:
>>> static inline void avecintc_enable(void)
>>> {
>>> +#ifdef CONFIG_MACH_LOONGSON64
>>> u64 value;
>>>
>>> value = iocsr_read64(LOONGARCH_IOCSR_MISC_FUNC);
>>> value |= IOCSR_MISC_FUNC_AVEC_EN;
>>> iocsr_write64(value, LOONGARCH_IOCSR_MISC_FUNC);
>>> +#endif
>>
>> Can't this be:
>>
>> if (IS_ENABLED(CONFIG_MACH_LOONGSON64))
>>
>> which is preferred over ifdeffery?
>
> Sadly, iocsr_read64 symbol is only available on 64 bit systems,
> so it must be guarded somehow.
It's unconditionally defined so using IS_ENABLED() is fine because the
compiler optimizes everything out before the resolv stage.
Thanks,
tglx