From patchwork Fri Feb 3 19:18:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 93301 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp738102qgi; Fri, 3 Feb 2017 11:21:01 -0800 (PST) X-Received: by 10.36.77.149 with SMTP id l143mr2252656itb.19.1486149661252; Fri, 03 Feb 2017 11:21:01 -0800 (PST) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z18si1936167ita.99.2017.02.03.11.21.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Feb 2017 11:21:01 -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 1cZjO7-0004CB-Fa; Fri, 03 Feb 2017 19:19:15 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZjO6-00048x-RX for xen-devel@lists.xen.org; Fri, 03 Feb 2017 19:19:14 +0000 Received: from [193.109.254.147] by server-2.bemta-6.messagelabs.com id AE/86-22326-2B7D4985; Fri, 03 Feb 2017 19:19:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTXfT9Sk RBgs2sFks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnX248yF1zgq5i06SdrA+N5ri5GLg4hgc2M Euf7PzBCOKcZJY7+nMjaxcjJwSagKXHn8ycmEFtEQFri2ufLjCA2s0CUxJ2LO1lAbGEBb4kz3 9eD1bMIqErM/L2YDcTmFXCR+PVxHZgtISAncfLYZLAaTgFXie/n1oHNFAKqWdzewTKBkXsBI8 MqRo3i1KKy1CJdI1O9pKLM9IyS3MTMHF1DAzO93NTi4sT01JzEpGK95PzcTYxADzMAwQ7GVQs CDzFKcjApifIWXZsSIcSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mCVx8kJ1iUmp5akZaZAww1mLQE B4+SCO9KkDRvcUFibnFmOkTqFKOilDivMUhCACSRUZoH1wYL70uMslLCvIxAhwjxFKQW5WaWo Mq/YhTnYFQS5rUHmcKTmVcCN/0V0GImoMU/H08CWVySiJCSamB0dF937HfNZL+Krya/Y3tWHv l4aGvHYa6p+rPuVExzup+29tnf6pOPH2x99f/+3yOl0+0y75e+z5h1q7nxup7LuVkHRQRWVwX u39RgtVdZ/BVjS7r5jRv/p549qh7rfXzS9B8HlnLxvzFgNun79mnWmtgVqzwcxC51bVpv0Gk0 JWk676fl90/8XajEUpyRaKjFXFScCAB1tlgyagIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1486149553!54820200!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 8430 invoked from network); 3 Feb 2017 19:19:13 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-11.tower-27.messagelabs.com with SMTP; 3 Feb 2017 19:19:13 -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 3E30C152B; Fri, 3 Feb 2017 11:19:13 -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 7DAF33F242; Fri, 3 Feb 2017 11:19:12 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 3 Feb 2017 19:18:48 +0000 Message-Id: <1486149538-20432-5-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 2/8] 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 Reviewed-by: Stefano Stabellini --- 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; }