ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
authorHanjun Guo <hanjun.guo@linaro.org>
Tue, 18 Feb 2014 16:23:57 +0000 (00:23 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 18 Feb 2014 23:56:07 +0000 (00:56 +0100)
BAD_MADT_ENTRY() is arch independent and will be used for all
architectures which parse MADT, so move it to linux/acpi.h to
reduce code duplication.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/ia64/kernel/acpi.c
arch/x86/kernel/acpi/boot.c
include/linux/acpi.h

index 07d209c9507f292d80c45edc7b7433d78a78602b..467497ade45f82745129c384a638a9ea6b75378a 100644 (file)
 #include <asm/sal.h>
 #include <asm/cyclone.h>
 
-#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;
index 1dac94265b5978282262b77d4f496ae512701eb8..123f9e37eee40821b1576cd9dd9a7c7e83c56479 100644 (file)
@@ -53,10 +53,6 @@ EXPORT_SYMBOL(acpi_disabled);
 # include <asm/proto.h>
 #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 */
index 1151a1dcfe41d950339bef27d8f9b12fa40d5c68..6a15dddbaa09a1e55eaa09e56b4582fee94f4813 100644 (file)
@@ -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);