lib: utils/fdt: Replace strcmp with strncmp

Use strncmp() instead of strcmp() in __fixup_find_domain_offset()
so that it compiles fine when linking with external firmware (such
as EDK2).

Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Daniel Schaefer 2021-05-19 15:54:10 +08:00 committed by Anup Patel
parent ee7c2b27ea
commit fe92347b9f

View file

@ -96,7 +96,7 @@ static int __fixup_find_domain_offset(void *fdt, int doff, void *p)
{ {
struct __fixup_find_domain_offset_info *fdo = p; struct __fixup_find_domain_offset_info *fdo = p;
if (!strcmp(fdo->name, fdt_get_name(fdt, doff, NULL))) if (!strncmp(fdo->name, fdt_get_name(fdt, doff, NULL), strlen(fdo->name)))
*fdo->doffset = doff; *fdo->doffset = doff;
return 0; return 0;