cpu_logical_map is only defined for CONFIG_SMP builds, when we are in an UP configuration, the boot CPU is 0. Some kernel compilation error information is as follows: CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CHK include/generated/compile.h CC drivers/irqchip/irq-loongson-liointc.o drivers/irqchip/irq-loongson-liointc.c: In function 'liointc_chained_handle_irq': drivers/irqchip/irq-loongson-liointc.c:60:13: error: implicit declaration of function 'cpu_logical_map' [-Werror=implicit-function-declaration] int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES; ^~~~~~~~~~~~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:249:drivers/irqchip/irq-loongson-liointc.o] error 1 make[1]: *** [scripts/Makefile.build:466:drivers/irqchip] error 2 Acked-by: Caicai <caizp2008@xxxxxxx> Signed-off-by: Yupeng Li <liyupeng@xxxxxxxxxx> --- drivers/irqchip/irq-loongson-liointc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index aed88857d90f..927e236bf18e 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -57,7 +57,11 @@ static void liointc_chained_handle_irq(struct irq_desc *desc) struct liointc_handler_data *handler = irq_desc_get_handler_data(desc); struct irq_chip *chip = irq_desc_get_chip(desc); struct irq_chip_generic *gc = handler->priv->gc; +#ifdef CONFIG_SMP int core = cpu_logical_map(smp_processor_id()) % LIOINTC_NUM_CORES; +#else + int core = 0; +#endif u32 pending; chained_irq_enter(chip, desc); -- 2.34.1