From patchwork Tue Feb 18 13:54:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 3670941 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6304A9F2EC for ; Tue, 18 Feb 2014 13:59:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 887BE2016C for ; Tue, 18 Feb 2014 13:59:06 +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 90A4920166 for ; Tue, 18 Feb 2014 13:59:04 +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 1WFlB2-0001AM-90; Tue, 18 Feb 2014 13:57:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFlAg-0004el-AX; Tue, 18 Feb 2014 13:57:14 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFlAG-0004YU-Bo for linux-arm-kernel@lists.infradead.org; Tue, 18 Feb 2014 13:56:50 +0000 Received: by mail-pd0-f182.google.com with SMTP id v10so16267536pde.13 for ; Tue, 18 Feb 2014 05:56:26 -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=hRoUgPOa83XDwgERxWGpT8zmoxnDI2PYFD40hM89mm1UCu1GtGLbBlT1wTe/P9Ek/S WVtSOYnO5hxFCdvcOrHA/AJ8F+fYz8nCYzS9cF5pCpgUfD5lL10v/py+5atqnwgID4E0 KVtR6b+SIje50Fb7dbOhzCVLTY6s4OWu+5SXPwpNHwWnUe8ttdhDOTo4ph8f0tf2UW25 DBiEz5AGO/p8wTLSKkTCO1yrXG3E2ibSDyQga/eCVXnUPR0aO4a+wp3oE+jsd+gbN8se 4BoOveE6roBFgToBgdoCd/5XuJF06Q3pFM6ZSy/UqGL47z09V2tILRTT00oahqKcrRuX KzJA== X-Gm-Message-State: ALoCoQkc1tH6QgRe4YYHinOcl4eyv5E6mMwA+MVaLrvT/dIcpoRxB35t+tSQ6Jna7EkWqcGns8mi X-Received: by 10.66.119.136 with SMTP id ku8mr33122447pab.121.1392731786544; Tue, 18 Feb 2014 05:56:26 -0800 (PST) Received: from localhost ([39.181.46.96]) by mx.google.com with ESMTPSA id un5sm142832754pab.3.2014.02.18.05.56.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 18 Feb 2014 05:56:25 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" Subject: [PATCH v4 4/5] ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h Date: Tue, 18 Feb 2014 21:54:59 +0800 Message-Id: <1392731700-10992-5-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392731700-10992-1-git-send-email-hanjun.guo@linaro.org> References: <1392731700-10992-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_085648_523141_4B8E67C6 X-CRM114-Status: GOOD ( 10.50 ) X-Spam-Score: -1.9 (-) Cc: Lan Tianyu , linaro-acpi@lists.linaro.org, patches@linaro.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Hanjun Guo , 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);