Commit 2e99b73a authored by Bibo Mao's avatar Bibo Mao Committed by Marc Zyngier

irqchip/loongson-eiointc: Fix return value checking of eiointc_index

Return value of function eiointc_index is int, however it is converted
into uint32_t and then compared smaller than zero, this will cause logic
problem.

Fixes: dd281e1a ("irqchip: Add Loongson Extended I/O interrupt controller support")
Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230811095805.2974722-2-maobibo@loongson.cn
parent 6eaae198
......@@ -144,7 +144,7 @@ static int eiointc_router_init(unsigned int cpu)
int i, bit;
uint32_t data;
uint32_t node = cpu_to_eio_node(cpu);
uint32_t index = eiointc_index(node);
int index = eiointc_index(node);
if (index < 0) {
pr_err("Error: invalid nodemap!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment