From patchwork Thu May 19 16:15:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 68172 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp3293649qge; Thu, 19 May 2016 09:17:15 -0700 (PDT) X-Received: by 10.66.246.165 with SMTP id xx5mr20974566pac.87.1463674634823; Thu, 19 May 2016 09:17:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8si20934130pay.32.2016.05.19.09.17.14; Thu, 19 May 2016 09:17:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932750AbcESQQ7 (ORCPT + 30 others); Thu, 19 May 2016 12:16:59 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:36130 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932667AbcESQQ4 (ORCPT ); Thu, 19 May 2016 12:16:56 -0400 Received: by mail-lb0-f176.google.com with SMTP id h1so26389069lbj.3 for ; Thu, 19 May 2016 09:16:55 -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=EituwITSQU61deFBkuWc68RTdgy1aEojsTBgk0vDVNo=; b=hvjra3LygA0JtO/DFBERPR6UezUos1wuU63xxAyUub7tmbQ3VRCtEnyeWad3Yi/2C5 /6zx81gkoY0/iiFEN8+qaA3F9F5Ogo4e0DqMtp8Tll/CLvMgPSQVIMeHITrVzWM2wdFG GGVkoivkGR6q6JgbCBJmDLjewD51uGIa5LoGM= 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=EituwITSQU61deFBkuWc68RTdgy1aEojsTBgk0vDVNo=; b=XFqtp3q1H8yHfGnGmap3fYFXVWfrez7s02XLAlm7SbHiIEV4N04nQ8WVL/pMeP5o3V LqWUhxsXjdu4iJu65YMHW8jVnc/sU3I4GP/p+88Pg9bfRMPCi6NC7HB81dN49ewdCtIC 2YG3tikAPRYGLAoGwvSeIYVYmW/RywhMePA4QUgpItgZkLQGNmdUu/yC4IJl4RTeM8kc BgwiPnEoJFzVnDeYi+yYp8nDPvac39gk7DeJ0nteJ8+KxkQFuUYiRd3HlNdpbIt8eNvl rnfzhwm8i/FxkmZ8VfhRcri1b/WZFcvi+YqvFFRjupQiPEOb7VClxkNIxR+1JgA3BsFh x91Q== X-Gm-Message-State: AOPr4FXtyVdaqHBADYICS9/9RsTsNwVqO29LMfIIqhv56kh/5imkecHMiALC36jaSxqZf7/J X-Received: by 10.112.220.6 with SMTP id ps6mr4939751lbc.16.1463674614634; Thu, 19 May 2016 09:16:54 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id yf9sm2396538lbb.34.2016.05.19.09.16.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 09:16:53 -0700 (PDT) From: Aleksey Makarov To: Russell King , "Rafael J . Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Aleksey Makarov , Graeme Gregory , Jon Masters , "Zheng, Lv" , Mark Rutland , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Subject: [PATCH v2 2/5] ACPI: table upgrade: refactor function definitions Date: Thu, 19 May 2016 19:15:13 +0300 Message-Id: <1463674518-22477-3-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463674518-22477-1-git-send-email-aleksey.makarov@linaro.org> References: <1463674518-22477-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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.2 diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index c4e7b39..aac91be 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 288fac5..ef2ad26 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, @@ -588,7 +587,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) { } @@ -997,4 +995,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*/