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: 24849 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 06091202B2 for ; Tue, 18 Feb 2014 13:56:28 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf29229538iec.0 for ; Tue, 18 Feb 2014 05:56: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: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=IjM13BPjgk8ZZ4KZqGcW73WN/pIRLKtdZtWFKbMTstbJTsIBy3DF9lLlbZkItHm7lP 2cEfyCoIdz98Q0h0RVKo4OjCvg8r4HJHsX9T+Pm7MfM9reXn45zqd4Wh5RPIjW4mR0uD TxxfvagPzrLfJRus6ro9oamJna2QkideXT3KVZR+iFmuI5xKP2i+0NZKd2LpPbARE7yi z6ygayuh8Pj4M/02LwbKAcAW3neqhbufkIbt/XyQvgG52xmwmCAZCnIp8tJILGjRS1/C CkoOnmTMqr4ldzSw/HmSzFIoKsyPaYisVn/MdNOOaMwVoTWtLVdJgwcvsC9Q9bWGzOTE KKPA== X-Gm-Message-State: ALoCoQnxebm3oApOsTKesPjKMLJWCeE8nGCfB7ZF+5pEPVGhhaH2aTxFV2xBMKxawwOuaeaYMRJa X-Received: by 10.50.8.3 with SMTP id n3mr10919396iga.0.1392731788218; Tue, 18 Feb 2014 05:56:28 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.6 with SMTP id 6ls1276791qgy.16.gmail; Tue, 18 Feb 2014 05:56:28 -0800 (PST) X-Received: by 10.52.68.106 with SMTP id v10mr517236vdt.59.1392731788100; Tue, 18 Feb 2014 05:56:28 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id sq4si5504473vdc.67.2014.02.18.05.56.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 05:56:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 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.178; Received: by mail-ve0-f178.google.com with SMTP id oy12so13214119veb.23 for ; Tue, 18 Feb 2014 05:56:28 -0800 (PST) X-Received: by 10.52.240.228 with SMTP id wd4mr46351vdc.70.1392731788008; Tue, 18 Feb 2014 05:56:28 -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 u4csp218210vcz; Tue, 18 Feb 2014 05:56:27 -0800 (PST) X-Received: by 10.68.130.234 with SMTP id oh10mr15101730pbb.136.1392731787076; Tue, 18 Feb 2014 05:56:27 -0800 (PST) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by mx.google.com with ESMTPS id gz8si18377841pac.317.2014.02.18.05.56.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 05:56:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.52 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.160.52; Received: by mail-pb0-f52.google.com with SMTP id jt11so16712143pbb.25 for ; Tue, 18 Feb 2014 05:56:26 -0800 (PST) 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" Cc: Lan Tianyu , 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 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-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.178 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);