[PATCH v2 3/3] lib: fix irqchip_plic_update_hartid_table

Anup Patel anup at brainfault.org
Fri Dec 9 00:41:49 PST 2022


On Thu, Dec 8, 2022 at 6:44 AM Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> After determining cpu_offset we have to check this value.
>
> Addresses-Coverity-ID: 1529706 ("Logically dead code")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> Reviewed-by: Xiang W <wxjstz at 126.com>
> Reviewed-by: Atish Patra <atishp at rivosinc.com>

Looks good to me.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
> v2:
>         add reviewed-by lines
> ---
>  lib/utils/irqchip/fdt_irqchip_plic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/utils/irqchip/fdt_irqchip_plic.c b/lib/utils/irqchip/fdt_irqchip_plic.c
> index a6e185c..fe08836 100644
> --- a/lib/utils/irqchip/fdt_irqchip_plic.c
> +++ b/lib/utils/irqchip/fdt_irqchip_plic.c
> @@ -86,7 +86,7 @@ static int irqchip_plic_update_hartid_table(void *fdt, int nodeoff,
>                         continue;
>
>                 cpu_offset = fdt_parent_offset(fdt, cpu_intc_offset);
> -               if (cpu_intc_offset < 0)
> +               if (cpu_offset < 0)
>                         continue;
>
>                 err = fdt_parse_hart_id(fdt, cpu_offset, &hartid);
> --
> 2.37.2
>



More information about the opensbi mailing list