diff mbox series

hdata: assert if we fail to add xscom nodes

Message ID 20201127131449.726687-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series hdata: assert if we fail to add xscom nodes | expand

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (b825589e085e23add8d0c58cfde7c8ed1f0b2dfd)

Commit Message

Vasant Hegde Nov. 27, 2020, 1:14 p.m. UTC
If we have duplicate xscom nodes then it will fail to attach xscom
node to device tree and we will fail eventully. Better to call assert()
and fail here.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hdata/spira.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Vasant Hegde Dec. 16, 2020, 8:01 a.m. UTC | #1
On 11/27/20 6:44 PM, Vasant Hegde wrote:
> If we have duplicate xscom nodes then it will fail to attach xscom
> node to device tree and we will fail eventully. Better to call assert()
> and fail here.
> 

Merged to master as f6ea3719782c478e.

-Vasant
diff mbox series

Patch

diff --git a/hdata/spira.c b/hdata/spira.c
index deb2dea44..2e3b3a463 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -315,8 +315,7 @@  static struct dt_node *add_xscom_node(uint64_t base, uint32_t hw_id,
 	       hw_id, proc_chip_id, (long long)addr);
 
 	node = dt_new_addr(dt_root, "xscom", addr);
-	if (!node)
-		return NULL;
+	assert(node);
 
 	dt_add_property_cells(node, "ibm,chip-id", hw_id);
 	dt_add_property_cells(node, "ibm,proc-chip-id", proc_chip_id);