From patchwork Fri Feb 3 19:18:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 93308 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp738148qgi; Fri, 3 Feb 2017 11:21:07 -0800 (PST) X-Received: by 10.36.84.148 with SMTP id t142mr2415717ita.90.1486149667125; Fri, 03 Feb 2017 11:21:07 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id m187si2001342itm.42.2017.02.03.11.21.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 11:21:07 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZjO6-0004Ap-Ty; Fri, 03 Feb 2017 19:19:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZjO5-00048x-7n for xen-devel@lists.xen.org; Fri, 03 Feb 2017 19:19:13 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 53/86-22326-0B7D4985; Fri, 03 Feb 2017 19:19:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXf99Sk RBi8X2Vgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnX248yF1zgq5i06SdrA+N5ri5GLg4hgc2M Eofb29kgnNOMEl9Pn2PuYuTkYBPQlLjz+RMTiC0iIC1x7fNlRhCbWSBK4s7FnSwgtrCAt8Tum w/A6lkEVCX+3pjMCmLzCrhIXO3YCdYrISAncfIYRJxTwFXi+7l1YHEhoJrF7R0sExi5FzAyrG JUL04tKkst0jXWSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCrWS87P3cQI9C8DEOxg7PjndIh RkoNJSZS36NqUCCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvAtAcoJFqempFWmZOcBAg0lLcPAo ifCuBEnzFhck5hZnpkOkTjEqSonzGoMkBEASGaV5cG2w4L7EKCslzMsIdIgQT0FqUW5mCar8K 0ZxDkYlYd5akCk8mXklcNNfAS1mAlr88/EkkMUliQgpqQZGneD1RiIn9j698/Gg9o+7Gm378z a+OSct0dUY12EqU8tQkH5Ga+eTxIX3uwt4Wk+u6NrM/VjG61h+x9R3lt88xJzTXFrd16432cA rarj65D22WzXbFqzhj0ztufyKY7OCQLelvpRXfVa8xLGCGW+bt9o5vH74zuTbkVsP7FeuFQ8T r17u+FleiaU4I9FQi7moOBEA/dCrSmkCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1486149551!42103251!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48696 invoked from network); 3 Feb 2017 19:19:11 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-21.messagelabs.com with SMTP; 3 Feb 2017 19:19:11 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4814C154D; Fri, 3 Feb 2017 11:19:11 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 898C43F242; Fri, 3 Feb 2017 11:19:10 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 3 Feb 2017 19:18:46 +0000 Message-Id: <1486149538-20432-3-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486149538-20432-1-git-send-email-julien.grall@arm.com> References: <1486149538-20432-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, shankerd@codeaurora.org Subject: [Xen-devel] [PATCH 1/7] xen/arm: acpi: Rework acpi_boot_table_init error paths X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" There are multiple path disable ACPI on error. Consolidate in a single place, this will help in a follow-up patch to add more code on the error path. Signed-off-by: Julien Grall --- xen/arch/arm/acpi/boot.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c index c3242a0..889208a 100644 --- a/xen/arch/arm/acpi/boot.c +++ b/xen/arch/arm/acpi/boot.c @@ -234,7 +234,7 @@ static int __init dt_scan_depth1_nodes(const void *fdt, int node, */ int __init acpi_boot_table_init(void) { - int error; + int error = 0; /* * Enable ACPI instead of device tree unless @@ -245,10 +245,7 @@ int __init acpi_boot_table_init(void) if ( param_acpi_off || ( !param_acpi_force && device_tree_for_each_node(device_tree_flattened, dt_scan_depth1_nodes, NULL))) - { - disable_acpi(); - return 0; - } + goto disable; /* * ACPI is disabled at this point. Enable it in order to parse @@ -260,16 +257,22 @@ int __init acpi_boot_table_init(void) error = acpi_table_init(); if ( error ) { - disable_acpi(); - return error; + printk("%s: Unable to initialize table parser (%d)\n", + __FUNCTION__, error); + goto disable; } - if ( acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt) ) + error = acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt); + if ( error ) { - /* disable ACPI if no FADT is found */ - disable_acpi(); - printk("Can't find FADT\n"); + printk("%s: FADT not found (%d)\n", __FUNCTION__, error); + goto disable; } return 0; + +disable: + disable_acpi(); + + return error; }