[PATCH] utils: Use cpu_to_fdt32() when writing to fdt

Anup Patel Anup.Patel at wdc.com
Wed Jul 24 20:32:39 PDT 2019



> -----Original Message-----
> From: opensbi <opensbi-bounces at lists.infradead.org> On Behalf Of Georg
> Kotheimer
> Sent: Wednesday, July 24, 2019 3:08 PM
> To: opensbi at lists.infradead.org
> Cc: Georg Kotheimer <georg.kotheimer at kernkonzept.com>
> Subject: [PATCH] utils: Use cpu_to_fdt32() when writing to fdt
> 
> Although it does not make a functional difference, both cpu_to_fdt32() and
> fdt32_to_cpu() pass on to CPU_TO_FDT32, we should use cpu_to_fdt32() to
> be semantically correct.
> 
> Signed-off-by: Georg Kotheimer <georg.kotheimer at kernkonzept.com>
> ---
>  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
> 2cd055e..5dcbce0 100644
> --- a/lib/utils/irqchip/plic.c
> +++ b/lib/utils/irqchip/plic.c
> @@ -68,7 +68,7 @@ void plic_fdt_fixup(void *fdt, const char *compat)
> 
>  	for (i = 0; i < (cells_count / 2); i++) {
>  		if (fdt32_to_cpu(cells[2 * i + 1]) == IRQ_M_EXT)
> -			cells[2 * i + 1] = fdt32_to_cpu(0xffffffff);
> +			cells[2 * i + 1] = cpu_to_fdt32(0xffffffff);
>  	}
>  }
> 
> --
> 2.20.1
> 
> 
> _______________________________________________
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

Acked-by: Anup Patel <anup.patel at wdc.com>

Applied this path on riscv/opensbi repo

Thanks,
Anup



More information about the opensbi mailing list