[PATCH v2 3/3] lib: utils: Replace strcmp with strncmp

Anup Patel Anup.Patel at wdc.com
Wed May 19 13:52:50 BST 2021



> -----Original Message-----
> From: Daniel Schaefer <daniel.schaefer at hpe.com>
> Sent: 19 May 2021 13:24
> To: opensbi at lists.infradead.org
> Cc: Abner Chang <abner.chang at hpe.com>; Anup Patel
> <Anup.Patel at wdc.com>; Xiang W <wxjstz at 126.com>
> Subject: [PATCH v2 3/3] lib: utils: Replace strcmp with strncmp
> 
> Cc: Abner Chang <abner.chang at hpe.com>
> Cc: Anup Patel <Anup.Patel at wdc.com>
> Signed-off-by: Daniel Schaefer <daniel.schaefer at hpe.com>
> Reviewed-by: Xiang W <wxjstz at 126.com>
> Reviewed-by: Abner Chang <abner.chang at hpe.com>

Looks good to me. I have added some commit description
at time of merging this patch.

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

Regards,
Anup
> ---
>  lib/utils/fdt/fdt_domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c index
> fc8ad423eb88..676c75790829 100644
> --- a/lib/utils/fdt/fdt_domain.c
> +++ b/lib/utils/fdt/fdt_domain.c
> @@ -96,7 +96,7 @@ static int __fixup_find_domain_offset(void *fdt, int
> doff, void *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;
> 
>  	return 0;
> --
> 2.30.1




More information about the opensbi mailing list