diff mbox series

[16/17] lib: utils/irqchip: Don't check hartid in imsic_update_hartid_table()

Message ID 20230425123230.3943447-17-apatel@ventanamicro.com
State Superseded
Headers show
Series Introduce and use simple heap allocator | expand

Commit Message

Anup Patel April 25, 2023, 12:32 p.m. UTC
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>
---
 lib/utils/irqchip/fdt_irqchip_imsic.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Andrew Jones May 31, 2023, 1:14 p.m. UTC | #1
On Tue, Apr 25, 2023 at 06:02:29PM +0530, Anup Patel wrote:
> 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>
> ---
>  lib/utils/irqchip/fdt_irqchip_imsic.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/lib/utils/irqchip/fdt_irqchip_imsic.c b/lib/utils/irqchip/fdt_irqchip_imsic.c
> index d890400..574cadc 100644
> --- a/lib/utils/irqchip/fdt_irqchip_imsic.c
> +++ b/lib/utils/irqchip/fdt_irqchip_imsic.c
> @@ -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:
> -- 
> 2.34.1
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
diff mbox series

Patch

diff --git a/lib/utils/irqchip/fdt_irqchip_imsic.c b/lib/utils/irqchip/fdt_irqchip_imsic.c
index d890400..574cadc 100644
--- a/lib/utils/irqchip/fdt_irqchip_imsic.c
+++ b/lib/utils/irqchip/fdt_irqchip_imsic.c
@@ -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: