diff options
| author | Abner Chang <[email protected]> | 2020-07-25 17:30:41 +0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2020-07-29 12:13:51 +0530 |
| commit | 2cfd2fc9048806353298a1b967abf985901e36e8 (patch) | |
| tree | 8d2548b2242df7713a9f5b1a9a2f4796852ac788 | |
| parent | 2845d2d2cf4fb74a89452ba223995aa4a118c07e (diff) | |
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 <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/utils/fdt/fdt_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c index 78077f79..aec73a05 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); |
