diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2018-09-07 10:46:55 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-09-13 15:20:01 +1000 |
commit | 50d508c3cd62499ae0d3c6f0f800926869a1cd01 (patch) | |
tree | 7a33d4b7a69c3e124b3fef9adfa001f8c60d4dc8 | |
parent | 70a7a3fdfa36c2e105fd02061d4f440d22f99d7a (diff) | |
download | skiboot-50d508c3cd62499ae0d3c6f0f800926869a1cd01.zip skiboot-50d508c3cd62499ae0d3c6f0f800926869a1cd01.tar.gz skiboot-50d508c3cd62499ae0d3c6f0f800926869a1cd01.tar.bz2 |
hdata: Make sure reserved node name starts with "ibm, "
HDAT does not provide consistent label format for reserved memory label.
Few starts with "ibm," while few other starts with component name.
Lets make sure all the reserved node name starts with "ibm,".
Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hdata/memory.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hdata/memory.c b/hdata/memory.c index c922260..7d5f3b3 100644 --- a/hdata/memory.c +++ b/hdata/memory.c @@ -567,6 +567,8 @@ static struct dt_node *dt_hb_reserves; static struct dt_node *add_hb_reserve_node(const char *name, u64 start, u64 end) { + /* label size + "ibm," + NULL */ + char node_name[HB_RESERVE_MEM_LABEL_SIZE + 5] = { 0 }; struct dt_node *node, *hb; if (!dt_hb_reserves) { @@ -580,10 +582,15 @@ static struct dt_node *add_hb_reserve_node(const char *name, u64 start, u64 end) dt_add_property_cells(dt_hb_reserves, "#address-cells", 2); } - node = dt_new_addr(dt_hb_reserves, name, start); + /* Add "ibm," to reserved node name */ + if (strncasecmp(name, "ibm", 3)) + snprintf(node_name, 5, "ibm,"); + strcat(node_name, name); + + node = dt_new_addr(dt_hb_reserves, node_name, start); if (!node) { prerror("Unable to create node for %s@%llx\n", - name, (unsigned long long) start); + node_name, (unsigned long long) start); return NULL; } |