[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAAhV-H7NtSkWKeP5Kq0fvNM0qqWfTq7TAeGpmnkmPSJBBzu1KA@mail.gmail.com>
Date: Tue, 13 Jan 2026 12:41:59 +0800
From: Huacai Chen <chenhuacai@...il.com>
To: Thomas Gleixner <tglx@...nel.org>
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>, Huacai Chen <chenhuacai@...ngson.cn>,
loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>
Subject: Re: [PATCH 1/7] irqchip/loongarch-avec: Adjust irqchip driver for 32BIT/64BIT
On Sat, Jan 10, 2026 at 4:37 AM Thomas Gleixner <tglx@...nel.org> wrote:
>
> 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.
I'm sorry but IS_ENABLED() doesn't work in this case. Because
iocsr_read64() is not a regular function but a compiler intrinsic, it
is handled in the pre-process stage, so still causes build errors.
Please ignore my V2 and I will re-send V3, thanks.
Huacai
>
> Thanks,
>
> tglx
Powered by blists - more mailing lists