[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv5 8/8] lib/fdt: Change the default value of fdt_size_cells



see 2.3.5 in [1], if "#size-cells" is missing, the default value
should be 1 instead of 2.
Besides, upstream libfdt code also uses 1 [2]

[1]https://github.com/devicetree-org/devicetree-specification/releases/tag/v0.2
[2]https://github.com/dgibson/dtc/blob/eac2ad495b29f15d78daa2a7226653f36515cd7a/libfdt/fdt_addresses.c#L9

Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
Signed-off-by: Jia He <justin.he@xxxxxxx>
---
 lib/fdt/fdt_addresses.c  | 2 +-
 lib/fdt/include/libfdt.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/fdt/fdt_addresses.c b/lib/fdt/fdt_addresses.c
index eff4dbc..a1860e6 100644
--- a/lib/fdt/fdt_addresses.c
+++ b/lib/fdt/fdt_addresses.c
@@ -83,7 +83,7 @@ int fdt_size_cells(const void *fdt, int nodeoffset)
 
        sc = fdt_getprop(fdt, nodeoffset, "#size-cells", &len);
        if (!sc)
-               return 2;
+               return 1;
 
        if (len != sizeof(*sc))
                return -FDT_ERR_BADNCELLS;
diff --git a/lib/fdt/include/libfdt.h b/lib/fdt/include/libfdt.h
index 05dedbd..5622cf5 100644
--- a/lib/fdt/include/libfdt.h
+++ b/lib/fdt/include/libfdt.h
@@ -1091,7 +1091,7 @@ int fdt_address_cells(const void *fdt, int nodeoffset);
  *
  * returns:
  *     0 <= n < FDT_MAX_NCELLS, on success
- *      2, if the node has no #address-cells property
+ *      1, if the node has no #address-cells property
  *      -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
  *             #size-cells property
  *     -FDT_ERR_BADMAGIC,
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.