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: 24905 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 988CD202B2 for ; Tue, 18 Feb 2014 16:25:30 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id wp4sf64622067obc.1 for ; Tue, 18 Feb 2014 08:25:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=GzHKdBOtFJUEkJ9NNiiNW71jXyGyhTpo9shsVO/BFpI=; b=D2NskqparYXnoyBDqt57Fd537pOqeiNblJBJYN/9jyZIqIXI7dAuLYEjTceh8khKgH wYcE61+J9WQ/Px7P45QOfwwXIK1V8Mf9VI1JjHJOQB4oAJPvao/2Mz+RtHqLbfWHDcie ybEAvFkS3cnk47tTlWTu8sWlTCqTJjO9WSpL2kvGE9sN1ODWNlxMw3fimyw96PTXEZo8 YxiQP0MHiICpQaApxg0DcCx3uBJlbvZx9421USvZxDeJKRSPZXdVgF3qc7C1W8zw5PCL 4ImLXaDJwXPx6FxUgArOhOxVgOi9CSRGOeT9vFw7+Jvd0W+adSyjDoAIaHqQjqgEVmBC ocFw== X-Gm-Message-State: ALoCoQmZ0RpeBDincw0gKjPAQuWo7ro7SPTdmsIf3NU+aujqGVWH04pOQJyBGdmB1WcPm+1SLI4C X-Received: by 10.42.196.71 with SMTP id ef7mr12089433icb.24.1392740729508; Tue, 18 Feb 2014 08:25:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.199 with SMTP id d65ls1378861qge.12.gmail; Tue, 18 Feb 2014 08:25:29 -0800 (PST) X-Received: by 10.52.248.138 with SMTP id ym10mr18458320vdc.18.1392740729418; Tue, 18 Feb 2014 08:25:29 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id n17si5637512vcq.135.2014.02.18.08.25.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 08:25:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so13543151veb.41 for ; Tue, 18 Feb 2014 08:25:29 -0800 (PST) X-Received: by 10.52.230.105 with SMTP id sx9mr18532315vdc.10.1392740729335; Tue, 18 Feb 2014 08:25:29 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp229288vcz; Tue, 18 Feb 2014 08:25:29 -0800 (PST) X-Received: by 10.66.243.131 with SMTP id wy3mr34279778pac.32.1392740728592; Tue, 18 Feb 2014 08:25:28 -0800 (PST) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id l8si18856226pao.7.2014.02.18.08.25.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 08:25:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id lf10so16814441pab.18 for ; Tue, 18 Feb 2014 08:25:28 -0800 (PST) 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" Cc: Lan Tianyu , Joe Perches , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Hanjun Guo 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);