[PATCH v2 3/3] Use standard C string APIs in FDT helper
Anup Patel
Anup.Patel at wdc.com
Wed Jul 29 03:06:48 EDT 2020
> -----Original Message-----
> From: Abner Chang <abner.chang at hpe.com>
> Sent: 25 July 2020 15:01
> To: opensbi at lists.infradead.org
> Cc: abner.chang at hpe.com; Atish Patra <Atish.Patra at wdc.com>; Anup Patel
> <Anup.Patel at wdc.com>; Daniel Schaefer <daniel.schaefer at hpe.com>
> Subject: [PATCH v2 3/3] Use standard C string APIs in FDT helper
>
> Use strncmp instead of using sbi_strcmp directly in fdthelp.c.
>
> Signed-off-by: Abner Chang <abner.chang at hpe.com>
> Reviewed-by: Atish Patra <atish.patra at wdc.com>
> Reviewed-by: Anup Patel <anup.patel at wdc.com>
>
> Cc: Atish Patra <atish.patra at wdc.com>
> Cc: Anup Patel <anup.patel at wdc.com>
> Cc: Daniel Schaefer <daniel.schaefer at hpe.com>
> ---
> lib/utils/fdt/fdt_helper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index
> 78077f7..aec73a0 100644
> --- a/lib/utils/fdt/fdt_helper.c
> +++ b/lib/utils/fdt/fdt_helper.c
> @@ -123,7 +123,7 @@ int fdt_parse_hart_id(void *fdt, int cpu_offset, u32
> *hartid)
> prop = fdt_getprop(fdt, cpu_offset, "device_type", &len);
> if (!prop || !len)
> return SBI_EINVAL;
> - if (sbi_strcmp(prop, "cpu"))
> + if (strncmp (prop, "cpu", strlen ("cpu")))
> return SBI_EINVAL;
>
> val = fdt_getprop(fdt, cpu_offset, "reg", &len);
> --
> 2.25.0
Fixed patch subject at time of applying patch.
Applied this patch to the riscv/opensbi repo.
Thanks,
Anup
More information about the opensbi
mailing list