forked from Mirrors/opensbi
lib: utils: Use strncmp in fdt_parse_hart_id()
Use strncmp instead of using sbi_strcmp directly in fdt_parse_hart_id() to allow compiling fdt_helper.c by external firmware. Signed-off-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
@@ -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);
|
prop = fdt_getprop(fdt, cpu_offset, "device_type", &len);
|
||||||
if (!prop || !len)
|
if (!prop || !len)
|
||||||
return SBI_EINVAL;
|
return SBI_EINVAL;
|
||||||
if (sbi_strcmp(prop, "cpu"))
|
if (strncmp (prop, "cpu", strlen ("cpu")))
|
||||||
return SBI_EINVAL;
|
return SBI_EINVAL;
|
||||||
|
|
||||||
val = fdt_getprop(fdt, cpu_offset, "reg", &len);
|
val = fdt_getprop(fdt, cpu_offset, "reg", &len);
|
||||||
|
Reference in New Issue
Block a user