From patchwork Mon Jun 20 10:56:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 70437 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1447406qgy; Mon, 20 Jun 2016 03:58:16 -0700 (PDT) X-Received: by 10.98.70.144 with SMTP id o16mr20996479pfi.126.1466420296812; Mon, 20 Jun 2016 03:58:16 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id z8si23434275pae.115.2016.06.20.03.58.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 03:58:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bEwtE-0005Hl-AX; Mon, 20 Jun 2016 10:57:12 +0000 Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bEwsy-0005AI-4j for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2016 10:56:57 +0000 Received: by mail-lf0-x232.google.com with SMTP id l188so35086650lfe.2 for ; Mon, 20 Jun 2016 03:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+lbYkDDQd3H2yB/I/53RNwfU0ixXFGauPMQO0E9Mgyg=; b=AMul2MMNXDhESIAahiBl5fCpPJZ3Fexr1oD2AoPDC7CSajBPgjeJCeaECVxonAqpXM w+u/3OuxHL5a8OVlsmOWCa1ThN5LwXjC/Q/vUxl9v2AsAS9AWGOJRB5Q+HQ9q889E2nV VLaVkYny3KsfvIhyf+GaQSfESuOH3AsF7LtUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+lbYkDDQd3H2yB/I/53RNwfU0ixXFGauPMQO0E9Mgyg=; b=WgqkupNfp27rCpmjvJEO0lkA/UT7fqct5oo8dflAHucP1qQJXhm1hdTNgZNR2IioHj M+kg3tLhSmLc07Eo4y2YX04jDpuC+4h9y8mqVvlRGXBmQNw8hytQ27GSosenovc6X2Uw /OH2ce84+tbmsM30brBnjFxPczraKcf03yfDNmEiS8RvRNdCC3fDmvHlQbPqBGQkYTtr q4O3KoxrxnWKywD0jM1HbxgBHpo2qcvYijUixhZoHcQ/mGUlsxyIXjoZughMtKcTxqRp Xc7znaurQMV+TSIxONa1jvimkDQv1CCx6vjzM647ctnlht94JmC0r8ao5n1oM7Y/MJaO vWvg== X-Gm-Message-State: ALyK8tJ0ZEpum9tP48O9WL1RxSxha3MCfrHJhScUKWOkx5JSXU3C/ydlCFLowV2eyT+EeorE X-Received: by 10.46.5.15 with SMTP id 15mr3824749ljf.10.1466420194567; Mon, 20 Jun 2016 03:56:34 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id g28sm6367133ljg.24.2016.06.20.03.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 03:56:33 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" Subject: [PATCH v4 2/5] ACPI: table upgrade: refactor function definitions Date: Mon, 20 Jun 2016 13:56:10 +0300 Message-Id: <20160620105615.15538-3-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160620105615.15538-1-aleksey.makarov@linaro.org> References: <20160620105615.15538-1-aleksey.makarov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160620_035656_479000_338C2597 X-CRM114-Status: GOOD ( 13.78 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:232 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , x86@kernel.org, Graeme Gregory , Catalin Marinas , "H. Peter Anvin" , Will Deacon , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Aleksey Makarov , Ingo Molnar , "Zheng, Lv" , Jon Masters , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Len Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Refer initrd_start, initrd_end directly from drivers/acpi/tables.c. This allows to use the table upgrade feature in architectures other than x86. Also this simplifies header files. The patch renames acpi_table_initrd_init() to acpi_table_upgrade() (what reflects the purpose of the function) and removes the unneeded wraps early_acpi_table_init() and early_initrd_acpi_init(). Signed-off-by: Aleksey Makarov Acked-by: Lv Zheng --- arch/x86/kernel/setup.c | 9 +-------- drivers/acpi/tables.c | 14 ++++---------- include/linux/acpi.h | 8 ++++++-- 3 files changed, 11 insertions(+), 20 deletions(-) -- 2.8.3 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index eb2f3b5..09d2f5b 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -399,10 +399,6 @@ static void __init reserve_initrd(void) memblock_free(ramdisk_image, ramdisk_end - ramdisk_image); } -static void __init early_initrd_acpi_init(void) -{ - early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start); -} #else static void __init early_reserve_initrd(void) { @@ -410,9 +406,6 @@ static void __init early_reserve_initrd(void) static void __init reserve_initrd(void) { } -static void __init early_initrd_acpi_init(void) -{ -} #endif /* CONFIG_BLK_DEV_INITRD */ static void __init parse_setup_data(void) @@ -1146,7 +1139,7 @@ void __init setup_arch(char **cmdline_p) reserve_initrd(); - early_initrd_acpi_init(); + acpi_table_upgrade(); vsmp_init(); diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index f829e6a..b05df13 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "internal.h" #ifdef CONFIG_ACPI_CUSTOM_DSDT @@ -481,8 +482,10 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES); #define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT) -static void __init acpi_table_initrd_init(void *data, size_t size) +void __init acpi_table_upgrade(void) { + void *data = (void *)initrd_start; + size_t size = initrd_end - initrd_start; int sig, no, table_nr = 0, total_offset = 0; long offset = 0; struct acpi_table_header *table; @@ -696,10 +699,6 @@ next_table: } } #else -static void __init acpi_table_initrd_init(void *data, size_t size) -{ -} - static acpi_status acpi_table_initrd_override(struct acpi_table_header *existing_table, acpi_physical_address *address, @@ -742,11 +741,6 @@ acpi_os_table_override(struct acpi_table_header *existing_table, return AE_OK; } -void __init early_acpi_table_init(void *data, size_t size) -{ - acpi_table_initrd_init(data, size); -} - /* * acpi_table_init() * diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 9cab064..fb9d568 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -208,7 +208,6 @@ void acpi_boot_table_init (void); int acpi_mps_check (void); int acpi_numa_init (void); -void early_acpi_table_init(void *data, size_t size); int acpi_table_init (void); int acpi_table_parse(char *id, acpi_tbl_table_handler handler); int __init acpi_parse_entries(char *id, unsigned long table_size, @@ -592,7 +591,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev) return NULL; } -static inline void early_acpi_table_init(void *data, size_t size) { } static inline void acpi_early_init(void) { } static inline void acpi_subsystem_init(void) { } @@ -1009,4 +1007,10 @@ static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev, #define acpi_probe_device_table(t) ({ int __r = 0; __r;}) #endif +#ifdef CONFIG_ACPI_TABLE_UPGRADE +void acpi_table_upgrade(void); +#else +static inline void acpi_table_upgrade(void) { } +#endif + #endif /*_LINUX_ACPI_H*/