From patchwork Wed Jul 6 03:20:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 645082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rknwS5bNRz9s5J for ; Wed, 6 Jul 2016 14:34:48 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rknwS4skHzDr23 for ; Wed, 6 Jul 2016 14:34:48 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rknv83SR3zDqxb for ; Wed, 6 Jul 2016 14:33:40 +1000 (AEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u663E6cO120107 for ; Tue, 5 Jul 2016 23:20:12 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0b-001b2d01.pphosted.com with ESMTP id 240k6waqkq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 05 Jul 2016 23:20:11 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jul 2016 13:20:09 +1000 Received: from d23dlp02.au.ibm.com (202.81.31.213) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Jul 2016 13:20:07 +1000 X-IBM-Helo: d23dlp02.au.ibm.com X-IBM-MailFrom: gwshan@linux.vnet.ibm.com X-IBM-RcptTo: skiboot@lists.ozlabs.org Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 0F9A52BB0059 for ; Wed, 6 Jul 2016 13:20:07 +1000 (EST) Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u663K7wg3277088 for ; Wed, 6 Jul 2016 13:20:07 +1000 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u663K6pd002837 for ; Wed, 6 Jul 2016 13:20:06 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u663K6Z7002827; Wed, 6 Jul 2016 13:20:06 +1000 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 51E4CA0094; Wed, 6 Jul 2016 13:20:06 +1000 (AEST) Received: from gwshan (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 46917E3B4B; Wed, 6 Jul 2016 13:20:06 +1000 (AEST) Received: by gwshan (Postfix, from userid 1000) id 1F884942CAC; Wed, 6 Jul 2016 13:20:06 +1000 (AEST) From: Gavin Shan To: skiboot@lists.ozlabs.org Date: Wed, 6 Jul 2016 13:20:03 +1000 X-Mailer: git-send-email 2.1.0 In-Reply-To: <1467775203-12132-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1467775203-12132-1-git-send-email-gwshan@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16070603-0040-0000-0000-000001BD7BA1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070603-0041-0000-0000-00000A053C3D Message-Id: <1467775203-12132-3-git-send-email-gwshan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-06_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607060029 Subject: [Skiboot] [PATCH 3/3] hw/npu: assert() on PHB device node X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair@popple.id.au MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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");