From 6ddf71e6e90878ee107b0d9f98492ad27d31c73a Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Fri, 9 Aug 2019 17:13:58 -0600 Subject: [PATCH] lib: Use correct type for return value The error check 'plic_off < 0' does nothing, since plic_off is stored as a u32. Fix this by changing it to an int, which matches the return type of fdt_node_offset_by_compatible(). Signed-off-by: Jacob Garber Reviewed-by: Bin Meng Reviewed-by: Atish Patra --- lib/utils/irqchip/plic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/irqchip/plic.c b/lib/utils/irqchip/plic.c index 5dcbce0..ea09f0a 100644 --- a/lib/utils/irqchip/plic.c +++ b/lib/utils/irqchip/plic.c @@ -51,7 +51,7 @@ void plic_fdt_fixup(void *fdt, const char *compat) { u32 *cells; int i, cells_count; - u32 plic_off; + int plic_off; plic_off = fdt_node_offset_by_compatible(fdt, 0, compat); if (plic_off < 0)