[Skiboot] [PATCH 3/3] hw/npu: assert() on PHB device node

Gavin Shan gwshan at linux.vnet.ibm.com
Wed Jul 6 13:20:03 AEST 2016


This uses assert() to assure the PHB device node is created successfully
as we never hit the failing case as I image, to simplify the code.

Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
 hw/npu.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/hw/npu.c b/hw/npu.c
index a7f5523..a88d13c 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -1115,17 +1115,7 @@ static void npu_probe_phb(struct dt_node *dn)
 
 	/* Create PCI root device node */
 	np = dt_new_addr(dt_root, "pciex", at_bar[0]);
-	if (!np) {
-		/**
-		 * @fwts-label NPUPHBDeviceNodeFailure
-		 * @fwts-advice Error adding the PHB device node. The
-		 * only real reason for this is that firmware may have
-		 * run out of memory.
-		 */
-		prlog(PR_ERR, "%s: Cannot create PHB device node\n",
-		      __func__);
-		return;
-	}
+	assert(np);
 
 	dt_add_property_strings(np, "compatible",
 				"ibm,power8-npu-pciex", "ibm,ioda2-npu-phb");
-- 
2.1.0



More information about the Skiboot mailing list