OpenSBI Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Abner Chang <abner.chang@hpe.com>
To: opensbi@lists.infradead.org
Subject: [PATCH 3/3] Use standard C string APIs in FDT helper
Date: Thu, 23 Jul 2020 09:54:04 +0800	[thread overview]
Message-ID: <20200723015404.17667-4-abner.chang@hpe.com> (raw)
In-Reply-To: <20200723015404.17667-1-abner.chang@hpe.com>

Use strncmp instead of using sbi_strcmp directly in fdthelp.c.

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Atish Patra <atish.patra@wdc.com>
Cc: Anup Patel <anup.patel@wdc.com>
Cc: Daniel Schaefer <daniel.schaefer@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



  parent reply	other threads:[~2020-07-23  1:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  1:54 [PATCH 0/3] Use standard C string APIs in FDT helper Abner Chang
2020-07-23  1:54 ` [PATCH 1/3] " Abner Chang
2020-07-24  4:37   ` Anup Patel
2020-07-24  5:38     ` Chang, Abner
2020-07-25  5:21       ` Atish Patra
2020-07-25  5:22         ` Atish Patra
2020-07-25  9:20         ` Chang, Abner
2020-07-23  1:54 ` [PATCH 2/3] " Abner Chang
2020-07-24  4:38   ` Anup Patel
2020-07-23  1:54 ` Abner Chang [this message]
2020-07-24  4:40   ` [PATCH 3/3] " Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200723015404.17667-4-abner.chang@hpe.com \
    --to=abner.chang@hpe.com \
    --cc=opensbi@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox