From: Daniel Schaefer <daniel.schaefer@hpe.com>
To: opensbi@lists.infradead.org
Subject: [PATCH v2 2/3] lib: fdt: Don't use sbi_string functions
Date: Wed, 19 May 2021 15:54:09 +0800 [thread overview]
Message-ID: <20210519075410.8520-3-daniel.schaefer@hpe.com> (raw)
In-Reply-To: <20210519075410.8520-1-daniel.schaefer@hpe.com>
When SBI is built by external firmware, we need to use their functions,
defined in libfdt_env.h.
Just like 2cfd2fc9048806353298a1b967abf985901e36e8
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Anup Patel <Anup.Patel@wdc.com>
Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
---
lib/utils/fdt/fdt_domain.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c
index 95c195d65238..fc8ad423eb88 100644
--- a/lib/utils/fdt/fdt_domain.c
+++ b/lib/utils/fdt/fdt_domain.c
@@ -9,6 +9,7 @@
*/
#include <libfdt.h>
+#include <libfdt_env.h>
#include <sbi/sbi_domain.h>
#include <sbi/sbi_error.h>
#include <sbi/sbi_hartmask.h>
@@ -95,7 +96,7 @@ static int __fixup_find_domain_offset(void *fdt, int doff, void *p)
{
struct __fixup_find_domain_offset_info *fdo = p;
- if (!sbi_strcmp(fdo->name, fdt_get_name(fdt, doff, NULL)))
+ if (!strcmp(fdo->name, fdt_get_name(fdt, doff, NULL)))
*fdo->doffset = doff;
return 0;
@@ -287,7 +288,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
regions = &fdt_regions[fdt_domains_count][0];
/* Read DT node name */
- sbi_strncpy(dom->name, fdt_get_name(fdt, domain_offset, NULL),
+ strncpy(dom->name, fdt_get_name(fdt, domain_offset, NULL),
sizeof(dom->name));
dom->name[sizeof(dom->name) - 1] = '\0';
@@ -313,7 +314,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
/* Setup memregions from DT */
val32 = 0;
- sbi_memset(regions, 0,
+ memset(regions, 0,
sizeof(*regions) * (FDT_DOMAIN_REGION_MAX_COUNT + 1));
dom->regions = regions;
err = fdt_iterate_each_memregion(fdt, domain_offset, &val32,
@@ -337,7 +338,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)
continue;
if (FDT_DOMAIN_REGION_MAX_COUNT <= val32)
return SBI_EINVAL;
- sbi_memcpy(®ions[val32++], reg, sizeof(*reg));
+ memcpy(®ions[val32++], reg, sizeof(*reg));
}
/* Read "boot-hart" DT property */
--
2.30.1
next prev parent reply other threads:[~2021-05-19 7:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 7:54 [PATCH v2 0/3] Don't use SBI functions in fdt code Daniel Schaefer
2021-05-19 7:54 ` [PATCH v2 1/3] lib: utils: Add strncpy macro to libfdt_env.h Daniel Schaefer
2021-05-19 8:37 ` Xiang W
2021-05-19 12:51 ` Anup Patel
2021-05-19 12:54 ` Anup Patel
2021-05-19 7:54 ` Daniel Schaefer [this message]
2021-05-19 8:38 ` [PATCH v2 2/3] lib: fdt: Don't use sbi_string functions Xiang W
2021-05-19 12:52 ` Anup Patel
2021-05-19 12:54 ` Anup Patel
2021-05-19 7:54 ` [PATCH v2 3/3] lib: utils: Replace strcmp with strncmp Daniel Schaefer
2021-05-19 12:52 ` 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=20210519075410.8520-3-daniel.schaefer@hpe.com \
--to=daniel.schaefer@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