]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/acpi/boot.c
x86: remove unnecessary memset and NULL check after alloc_bootmem()
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / acpi / boot.c
index 11bd11847b19eb815bedd863f8062a276d7eba7b..977ed5cdeaa3b1b6a8d5f78b3446df7be7e21b53 100644 (file)
@@ -697,10 +697,6 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 #define HPET_RESOURCE_NAME_SIZE 9
        hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);
 
-       if (!hpet_res)
-               return 0;
-
-       memset(hpet_res, 0, sizeof(*hpet_res));
        hpet_res->name = (void *)&hpet_res[1];
        hpet_res->flags = IORESOURCE_MEM;
        snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, "HPET %u",
@@ -765,6 +761,16 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
  * Parse LAPIC entries in MADT
  * returns 0 on success, < 0 on error
  */
+
+static void __init acpi_register_lapic_address(unsigned long address)
+{
+       mp_lapic_addr = address;
+
+       set_fixmap_nocache(FIX_APIC_BASE, address);
+       if (boot_cpu_physical_apicid == -1U)
+               boot_cpu_physical_apicid  = GET_APIC_ID(read_apic_id());
+}
+
 static int __init acpi_parse_madt_lapic_entries(void)
 {
        int count;
@@ -786,7 +792,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
                return count;
        }
 
-       mp_register_lapic_address(acpi_lapic_addr);
+       acpi_register_lapic_address(acpi_lapic_addr);
 
        count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_SAPIC,
                                      acpi_parse_sapic, MAX_APICS);