[PATCH v2 4/4] bsps/shared/ofw: Bug fixes
G S Niteesh Babu
niteesh.gs at gmail.com
Sat Feb 6 17:40:12 UTC 2021
Fixed bugs in rtems_ofw_get_prop, rtems_ofw_get_prop_len
and removed hardcoded value.
---
bsps/shared/ofw/ofw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bsps/shared/ofw/ofw.c b/bsps/shared/ofw/ofw.c
index 78576ecf45..1c3a81785d 100644
--- a/bsps/shared/ofw/ofw.c
+++ b/bsps/shared/ofw/ofw.c
@@ -162,7 +162,7 @@ ssize_t rtems_ofw_get_prop_len(
return len + 1;
}
- if (prop == NULL && strcmp(propname, "/chosen") == 0) {
+ if (prop == NULL && offset == fdt_path_offset(fdtp, "/chosen")) {
if (strcmp(propname, "fdtbootcpu") == 0)
return sizeof(pcell_t);
if (strcmp(propname, "fdtmemreserv") == 0)
@@ -210,7 +210,7 @@ ssize_t rtems_ofw_get_prop(
return len + 1;
}
- if (prop == NULL && strcmp(propname, "/chosen") == 0) {
+ if (prop == NULL && offset == fdt_path_offset(fdtp, "/chosen")) {
if (strcmp(propname, "fdtbootcpu") == 0) {
cpuid = cpu_to_fdt32(fdt_boot_cpuid_phys(fdtp));
len = sizeof(cpuid);
@@ -240,7 +240,7 @@ ssize_t rtems_ofw_get_enc_prop(
{
ssize_t rv;
- assert(len % 4 == 0);
+ assert(len % sizeof(pcell_t) == 0);
rv = rtems_ofw_get_prop(node, prop, buf, len);
if (rv < 0) {
--
2.17.1
More information about the devel
mailing list