From patchwork Tue Feb 18 16:23:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 3673241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8123ABF13A for ; Tue, 18 Feb 2014 16:28:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9DFF120163 for ; Tue, 18 Feb 2014 16:28:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F0CC20160 for ; Tue, 18 Feb 2014 16:28:00 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFnUx-0002KR-Gj; Tue, 18 Feb 2014 16:26:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFnUW-0004DR-Gq; Tue, 18 Feb 2014 16:25:52 +0000 Received: from mail-pb0-f50.google.com ([209.85.160.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFnUT-0004BQ-NK for linux-arm-kernel@lists.infradead.org; Tue, 18 Feb 2014 16:25:50 +0000 Received: by mail-pb0-f50.google.com with SMTP id rq2so17076275pbb.9 for ; Tue, 18 Feb 2014 08:25:28 -0800 (PST) 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=GzHKdBOtFJUEkJ9NNiiNW71jXyGyhTpo9shsVO/BFpI=; b=b/IrdD/gUjKkVw0rqm0+eRneAi9AZotkHTjH/Y2SYEskCrF09K7LnprfFzq451DkVr B4nTsSxQ1rQEB3iVhOaKeeVhmpr75COrbioc/Dxt5Q8IzPpyQTJpYXZmFJAgCzsGCx76 YBxSCXMv+S+Z5hK9FPhyrM5r5a5/dpcwWBCxu4wksGe2CLd7uPQDvgWOBJdXryzVN0hU 1rm6/t8Ep4U/HLQN9H/rrZ6dCL/Rq8tKjHphs2zSKhq8yoxUPu+BclvZXQd5FUzZxnpl 2dNw15WtOlVhYDtU08dV2vzN9LX2r7QBxw37YlTjMs3gFx9TeD4UmlAU/ApQSAfckbAF 84fg== X-Gm-Message-State: ALoCoQmSJoRLyjvE3E2T6EOGS095RXdcxGRQaxIgGNgoniCTFWpQMTcZCRItDCirsp1yNgfnEqGR X-Received: by 10.67.14.69 with SMTP id fe5mr34473367pad.120.1392740728231; Tue, 18 Feb 2014 08:25:28 -0800 (PST) Received: from localhost ([39.181.46.96]) by mx.google.com with ESMTPSA id nm5sm57290062pbc.29.2014.02.18.08.25.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Feb 2014 08:25:27 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" Subject: [PATCH v5 4/5] ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h Date: Wed, 19 Feb 2014 00:23:57 +0800 Message-Id: <1392740638-2479-5-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392740638-2479-1-git-send-email-hanjun.guo@linaro.org> References: <1392740638-2479-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140218_112549_850919_18A0F95D X-CRM114-Status: GOOD ( 10.14 ) X-Spam-Score: -2.6 (--) Cc: Lan Tianyu , patches@linaro.org, linaro-acpi@lists.linaro.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Hanjun Guo , Joe Perches , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BAD_MADT_ENTRY() is arch independent and will be used for all archs which parsing MADT table, so move it to linux/acpi.h to simply the code. Signed-off-by: Hanjun Guo --- arch/ia64/kernel/acpi.c | 4 ---- arch/x86/kernel/acpi/boot.c | 4 ---- include/linux/acpi.h | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index af9d9e4..f7bd074 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -54,10 +54,6 @@ #include #include -#define BAD_MADT_ENTRY(entry, end) ( \ - (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ - ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) - #define PREFIX "ACPI: " unsigned int acpi_cpei_override; diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 1dac942..123f9e3 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -53,10 +53,6 @@ EXPORT_SYMBOL(acpi_disabled); # include #endif /* X86 */ -#define BAD_MADT_ENTRY(entry, end) ( \ - (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ - ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) - #define PREFIX "ACPI: " int acpi_noirq; /* skip ACPI IRQ initialization */ diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 1151a1d..6a15ddd 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -108,6 +108,10 @@ static inline void acpi_initrd_override(void *data, size_t size) } #endif +#define BAD_MADT_ENTRY(entry, end) ( \ + (!entry) || (unsigned long)entry + sizeof(*entry) > end || \ + ((struct acpi_subtable_header *)entry)->length < sizeof(*entry)) + char * __acpi_map_table (unsigned long phys_addr, unsigned long size); void __acpi_unmap_table(char *map, unsigned long size); int early_acpi_boot_init(void);