lib: utils/irqchip: Don't check hartid in imsic_update_hartid_table()
authorAnup Patel <apatel@ventanamicro.com>
Thu, 20 Apr 2023 04:44:43 +0000 (10:14 +0530)
committerAnup Patel <anup@brainfault.org>
Mon, 5 Jun 2023 11:21:07 +0000 (16:51 +0530)
The imsic_map_hartid_to_data() already checks hartid before using
so we don't need to check in imsic_update_hartid_table().

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
lib/utils/irqchip/fdt_irqchip_imsic.c

index 590b2022b0a10d2dc76a77cccae3c54600c0c2d5..d032ac8f540873bbfbeca13454be559c6590e64f 100644 (file)
@@ -12,7 +12,6 @@
 #include <sbi/riscv_asm.h>
 #include <sbi/sbi_error.h>
 #include <sbi/sbi_heap.h>
-#include <sbi/sbi_hartmask.h>
 #include <sbi_utils/fdt/fdt_helper.h>
 #include <sbi_utils/irqchip/fdt_irqchip.h>
 #include <sbi_utils/irqchip/imsic.h>
@@ -44,8 +43,6 @@ static int irqchip_imsic_update_hartid_table(void *fdt, int nodeoff,
                err = fdt_parse_hart_id(fdt, cpu_offset, &hartid);
                if (err)
                        return SBI_EINVAL;
-               if (SBI_HARTMASK_MAX_BITS <= hartid)
-                       return SBI_EINVAL;
 
                switch (hwirq) {
                case IRQ_M_EXT: