The comment for __acpi_map_table() is obvious wrong. In fact, after commit 1c14fa49 (x86: use early_ioremap in __acpi_map_table), the comment became stale, so remove it and add a new one.
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- arch/x86/kernel/acpi/boot.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 2627a81..665f857 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -141,16 +141,8 @@ static u32 irq_to_gsi(int irq) }
/* - * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, - * to map the target physical address. The problem is that set_fixmap() - * provides a single page, and it is possible that the page is not - * sufficient. - * By using this area, we can map up to MAX_IO_APICS pages temporarily, - * i.e. until the next __va_range() call. - * - * Important Safety Note: The fixed I/O APIC page numbers are *subtracted* - * from the fixed base. That's why we start at FIX_IO_APIC_BASE_END and - * count idx down while incrementing the phys address. + * __acpi_map_table() will be called before the memory allocation + * is ready, so call early_ioremap() to map tables. */ char *__init __acpi_map_table(unsigned long phys, unsigned long size) {
__initdata should come after the variable name being declared and nowhere else, in this way the variable will be placed in the intended section.
__init belongs after the return type on functions, not before it.
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- arch/x86/kernel/acpi/boot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 665f857..eb1d67d 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -45,7 +45,7 @@ #include <asm/smp.h>
#include "sleep.h" /* To include x86_acpi_suspend_lowlevel */ -static int __initdata acpi_force = 0; +static int acpi_force __initdata = 0; u32 acpi_rsdt_forced; int acpi_disabled; EXPORT_SYMBOL(acpi_disabled); @@ -743,7 +743,7 @@ static int __init acpi_parse_sbf(struct acpi_table_header *table) #ifdef CONFIG_HPET_TIMER #include <asm/hpet.h>
-static struct __initdata resource *hpet_res; +static struct resource *hpet_res __initdata;
static int __init acpi_parse_hpet(struct acpi_table_header *table) { @@ -820,7 +820,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table) * hpet_insert_resource inserts the HPET resources used into the resource * tree. */ -static __init int hpet_insert_resource(void) +static int __init hpet_insert_resource(void) { if (!hpet_res) return 1; @@ -1360,7 +1360,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d) * If your system is blacklisted here, but you find that acpi=force * works for you, please contact linux-acpi@vger.kernel.org */ -static struct dmi_system_id __initdata acpi_dmi_table[] = { +static struct dmi_system_id acpi_dmi_table[] __initdata = { /* * Boxes that need ACPI disabled */ @@ -1435,7 +1435,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { };
/* second table for DMI checks that should run after early-quirks */ -static struct dmi_system_id __initdata acpi_dmi_table_late[] = { +static struct dmi_system_id acpi_dmi_table_late[] __initdata = { /* * HP laptops which use a DSDT reporting as HP/SB400/10000, * which includes some code which overrides all temperature
No functional change. There are some copy code both in function early_acpi_parse_madt_lapic_addr_ovr() and acpi_parse_madt_lapic_entries(), introduce a helper function and use it to simplify the code.
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- arch/x86/kernel/acpi/boot.c | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-)
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index eb1d67d..743d1c51 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -865,12 +865,7 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) }
#ifdef CONFIG_X86_LOCAL_APIC -/* - * Parse LAPIC entries in MADT - * returns 0 on success, < 0 on error - */ - -static int __init early_acpi_parse_madt_lapic_addr_ovr(void) +static int __init acpi_parse_madt_lapic_addr_ovr(void) { int count;
@@ -896,29 +891,23 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void) return count; }
+static int __init early_acpi_parse_madt_lapic_addr_ovr(void) +{ + return acpi_parse_madt_lapic_addr_ovr(); +} + +/* + * Parse LAPIC entries in MADT + * returns 0 on success, < 0 on error + */ static int __init acpi_parse_madt_lapic_entries(void) { int count; int x2count = 0;
- if (!cpu_has_apic) - return -ENODEV; - - /* - * Note that the LAPIC address is obtained from the MADT (32-bit value) - * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value). - */ - - count = - acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE, - acpi_parse_lapic_addr_ovr, 0); - if (count < 0) { - printk(KERN_ERR PREFIX - "Error parsing LAPIC address override entry\n"); + count = acpi_parse_madt_lapic_addr_ovr(); + if (count < 0) return count; - } - - register_lapic_address(acpi_lapic_addr);
count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC, acpi_parse_sapic, MAX_LOCAL_APIC);
linaro-kernel@lists.linaro.org