[ACPI] Lindent all ACPI files
Len Brown [Fri, 5 Aug 2005 04:44:28 +0000 (00:44 -0400)]
Signed-off-by: Len Brown <len.brown@intel.com>

190 files changed:
arch/i386/kernel/acpi/boot.c
arch/i386/kernel/acpi/earlyquirk.c
arch/i386/kernel/acpi/sleep.c
arch/ia64/kernel/acpi-ext.c
arch/ia64/kernel/acpi.c
arch/x86_64/kernel/acpi/sleep.c
drivers/acpi/ac.c
drivers/acpi/acpi_memhotplug.c
drivers/acpi/asus_acpi.c
drivers/acpi/battery.c
drivers/acpi/blacklist.c
drivers/acpi/bus.c
drivers/acpi/button.c
drivers/acpi/container.c
drivers/acpi/debug.c
drivers/acpi/dispatcher/dsfield.c
drivers/acpi/dispatcher/dsinit.c
drivers/acpi/dispatcher/dsmethod.c
drivers/acpi/dispatcher/dsmthdat.c
drivers/acpi/dispatcher/dsobject.c
drivers/acpi/dispatcher/dsopcode.c
drivers/acpi/dispatcher/dsutils.c
drivers/acpi/dispatcher/dswexec.c
drivers/acpi/dispatcher/dswload.c
drivers/acpi/dispatcher/dswscope.c
drivers/acpi/dispatcher/dswstate.c
drivers/acpi/ec.c
drivers/acpi/event.c
drivers/acpi/events/evevent.c
drivers/acpi/events/evgpe.c
drivers/acpi/events/evgpeblk.c
drivers/acpi/events/evmisc.c
drivers/acpi/events/evregion.c
drivers/acpi/events/evrgnini.c
drivers/acpi/events/evsci.c
drivers/acpi/events/evxface.c
drivers/acpi/events/evxfevnt.c
drivers/acpi/events/evxfregn.c
drivers/acpi/executer/exconfig.c
drivers/acpi/executer/exconvrt.c
drivers/acpi/executer/excreate.c
drivers/acpi/executer/exdump.c
drivers/acpi/executer/exfield.c
drivers/acpi/executer/exfldio.c
drivers/acpi/executer/exmisc.c
drivers/acpi/executer/exmutex.c
drivers/acpi/executer/exnames.c
drivers/acpi/executer/exoparg1.c
drivers/acpi/executer/exoparg2.c
drivers/acpi/executer/exoparg3.c
drivers/acpi/executer/exoparg6.c
drivers/acpi/executer/exprep.c
drivers/acpi/executer/exregion.c
drivers/acpi/executer/exresnte.c
drivers/acpi/executer/exresolv.c
drivers/acpi/executer/exresop.c
drivers/acpi/executer/exstore.c
drivers/acpi/executer/exstoren.c
drivers/acpi/executer/exstorob.c
drivers/acpi/executer/exsystem.c
drivers/acpi/executer/exutils.c
drivers/acpi/fan.c
drivers/acpi/glue.c
drivers/acpi/hardware/hwacpi.c
drivers/acpi/hardware/hwgpe.c
drivers/acpi/hardware/hwregs.c
drivers/acpi/hardware/hwsleep.c
drivers/acpi/hardware/hwtimer.c
drivers/acpi/hotkey.c
drivers/acpi/ibm_acpi.c
drivers/acpi/motherboard.c
drivers/acpi/namespace/nsaccess.c
drivers/acpi/namespace/nsalloc.c
drivers/acpi/namespace/nsdump.c
drivers/acpi/namespace/nsdumpdv.c
drivers/acpi/namespace/nseval.c
drivers/acpi/namespace/nsinit.c
drivers/acpi/namespace/nsload.c
drivers/acpi/namespace/nsnames.c
drivers/acpi/namespace/nsobject.c
drivers/acpi/namespace/nsparse.c
drivers/acpi/namespace/nssearch.c
drivers/acpi/namespace/nsutils.c
drivers/acpi/namespace/nswalk.c
drivers/acpi/namespace/nsxfeval.c
drivers/acpi/namespace/nsxfname.c
drivers/acpi/namespace/nsxfobj.c
drivers/acpi/numa.c
drivers/acpi/osl.c
drivers/acpi/parser/psargs.c
drivers/acpi/parser/psloop.c
drivers/acpi/parser/psopcode.c
drivers/acpi/parser/psparse.c
drivers/acpi/parser/psscope.c
drivers/acpi/parser/pstree.c
drivers/acpi/parser/psutils.c
drivers/acpi/parser/pswalk.c
drivers/acpi/parser/psxface.c
drivers/acpi/pci_bind.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/pci_root.c
drivers/acpi/power.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/processor_perflib.c
drivers/acpi/processor_thermal.c
drivers/acpi/processor_throttling.c
drivers/acpi/resources/rsaddr.c
drivers/acpi/resources/rscalc.c
drivers/acpi/resources/rscreate.c
drivers/acpi/resources/rsdump.c
drivers/acpi/resources/rsio.c
drivers/acpi/resources/rsirq.c
drivers/acpi/resources/rslist.c
drivers/acpi/resources/rsmemory.c
drivers/acpi/resources/rsmisc.c
drivers/acpi/resources/rsutils.c
drivers/acpi/resources/rsxface.c
drivers/acpi/scan.c
drivers/acpi/sleep/poweroff.c
drivers/acpi/sleep/proc.c
drivers/acpi/sleep/wakeup.c
drivers/acpi/system.c
drivers/acpi/tables.c
drivers/acpi/tables/tbconvrt.c
drivers/acpi/tables/tbget.c
drivers/acpi/tables/tbgetall.c
drivers/acpi/tables/tbinstal.c
drivers/acpi/tables/tbrsdt.c
drivers/acpi/tables/tbutils.c
drivers/acpi/tables/tbxface.c
drivers/acpi/tables/tbxfroot.c
drivers/acpi/thermal.c
drivers/acpi/toshiba_acpi.c
drivers/acpi/utilities/utalloc.c
drivers/acpi/utilities/utcache.c
drivers/acpi/utilities/utcopy.c
drivers/acpi/utilities/utdebug.c
drivers/acpi/utilities/utdelete.c
drivers/acpi/utilities/uteval.c
drivers/acpi/utilities/utglobal.c
drivers/acpi/utilities/utinit.c
drivers/acpi/utilities/utmath.c
drivers/acpi/utilities/utmisc.c
drivers/acpi/utilities/utmutex.c
drivers/acpi/utilities/utobject.c
drivers/acpi/utilities/utstate.c
drivers/acpi/utilities/utxface.c
drivers/acpi/utils.c
drivers/acpi/video.c
include/acpi/acconfig.h
include/acpi/acdebug.h
include/acpi/acdisasm.h
include/acpi/acdispat.h
include/acpi/acevents.h
include/acpi/acexcep.h
include/acpi/acglobal.h
include/acpi/achware.h
include/acpi/acinterp.h
include/acpi/aclocal.h
include/acpi/acmacros.h
include/acpi/acnames.h
include/acpi/acnamesp.h
include/acpi/acobject.h
include/acpi/acopcode.h
include/acpi/acoutput.h
include/acpi/acparser.h
include/acpi/acpi.h
include/acpi/acpi_bus.h
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/acresrc.h
include/acpi/acstruct.h
include/acpi/actables.h
include/acpi/actbl.h
include/acpi/actbl1.h
include/acpi/actbl2.h
include/acpi/actbl71.h
include/acpi/actypes.h
include/acpi/acutils.h
include/acpi/amlcode.h
include/acpi/amlresrc.h
include/acpi/container.h
include/acpi/pdc_intel.h
include/acpi/platform/acenv.h
include/acpi/platform/acgcc.h
include/acpi/platform/aclinux.h
include/acpi/processor.h

index 55c0fbd..98d119c 100644 (file)
 
 #ifdef CONFIG_X86_64
 
-static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
+static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+}
 extern void __init clustered_apic_check(void);
-static inline int ioapic_setup_disabled(void) { return 0; }
+static inline int ioapic_setup_disabled(void)
+{
+       return 0;
+}
+
 #include <asm/proto.h>
 
-#else  /* X86 */
+#else                          /* X86 */
 
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <mach_apic.h>
 #include <mach_mpparse.h>
-#endif /* CONFIG_X86_LOCAL_APIC */
+#endif                         /* CONFIG_X86_LOCAL_APIC */
 
-#endif /* X86 */
+#endif                         /* X86 */
 
 #define BAD_MADT_ENTRY(entry, end) (                                       \
                (!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \
@@ -62,7 +68,7 @@ static inline int ioapic_setup_disabled(void) { return 0; }
 
 #ifdef CONFIG_ACPI_PCI
 int acpi_noirq __initdata;     /* skip ACPI IRQ initialization */
-int acpi_pci_disabled __initdata; /* skip ACPI PCI scan and IRQ initialization */
+int acpi_pci_disabled __initdata;      /* skip ACPI PCI scan and IRQ initialization */
 #else
 int acpi_noirq __initdata = 1;
 int acpi_pci_disabled __initdata = 1;
@@ -88,7 +94,7 @@ static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE;
 
 #define MAX_MADT_ENTRIES       256
 u8 x86_acpiid_to_apicid[MAX_MADT_ENTRIES] =
-                       { [0 ... MAX_MADT_ENTRIES-1] = 0xff };
+    {[0...MAX_MADT_ENTRIES - 1] = 0xff };
 EXPORT_SYMBOL(x86_acpiid_to_apicid);
 
 /* --------------------------------------------------------------------------
@@ -99,7 +105,7 @@ EXPORT_SYMBOL(x86_acpiid_to_apicid);
  * The default interrupt routing model is PIC (8259).  This gets
  * overriden if IOAPICs are enumerated (below).
  */
-enum acpi_irq_model_id         acpi_irq_model = ACPI_IRQ_MODEL_PIC;
+enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC;
 
 #ifdef CONFIG_X86_64
 
@@ -107,7 +113,7 @@ enum acpi_irq_model_id              acpi_irq_model = ACPI_IRQ_MODEL_PIC;
 char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
 {
        if (!phys_addr || !size)
-       return NULL;
+               return NULL;
 
        if (phys_addr < (end_pfn_map << PAGE_SHIFT))
                return __va(phys_addr);
@@ -134,8 +140,8 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
        unsigned long base, offset, mapped_size;
        int idx;
 
-       if (phys + size < 8*1024*1024) 
-               return __va(phys); 
+       if (phys + size < 8 * 1024 * 1024)
+               return __va(phys);
 
        offset = phys & (PAGE_SIZE - 1);
        mapped_size = PAGE_SIZE - offset;
@@ -154,7 +160,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size)
                mapped_size += PAGE_SIZE;
        }
 
-       return ((unsigned char *) base + offset);
+       return ((unsigned char *)base + offset);
 }
 #endif
 
@@ -172,7 +178,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
        if (!phys_addr || !size)
                return -EINVAL;
 
-       mcfg = (struct acpi_table_mcfg *) __acpi_map_table(phys_addr, size);
+       mcfg = (struct acpi_table_mcfg *)__acpi_map_table(phys_addr, size);
        if (!mcfg) {
                printk(KERN_WARNING PREFIX "Unable to map MCFG\n");
                return -ENODEV;
@@ -209,20 +215,17 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
 
        return 0;
 }
-#endif /* CONFIG_PCI_MMCONFIG */
+#endif                         /* CONFIG_PCI_MMCONFIG */
 
 #ifdef CONFIG_X86_LOCAL_APIC
-static int __init
-acpi_parse_madt (
-       unsigned long           phys_addr,
-       unsigned long           size)
+static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 {
-       struct acpi_table_madt  *madt = NULL;
+       struct acpi_table_madt *madt = NULL;
 
        if (!phys_addr || !size)
                return -EINVAL;
 
-       madt = (struct acpi_table_madt *) __acpi_map_table(phys_addr, size);
+       madt = (struct acpi_table_madt *)__acpi_map_table(phys_addr, size);
        if (!madt) {
                printk(KERN_WARNING PREFIX "Unable to map MADT\n");
                return -ENODEV;
@@ -232,22 +235,20 @@ acpi_parse_madt (
                acpi_lapic_addr = (u64) madt->lapic_address;
 
                printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
-                       madt->lapic_address);
+                      madt->lapic_address);
        }
 
        acpi_madt_oem_check(madt->header.oem_id, madt->header.oem_table_id);
-       
+
        return 0;
 }
 
-
 static int __init
-acpi_parse_lapic (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
 {
-       struct acpi_table_lapic *processor = NULL;
+       struct acpi_table_lapic *processor = NULL;
 
-       processor = (struct acpi_table_lapic*) header;
+       processor = (struct acpi_table_lapic *)header;
 
        if (BAD_MADT_ENTRY(processor, end))
                return -EINVAL;
@@ -260,20 +261,19 @@ acpi_parse_lapic (
 
        x86_acpiid_to_apicid[processor->acpi_id] = processor->id;
 
-       mp_register_lapic (
-               processor->id,                                     /* APIC ID */
-               processor->flags.enabled);                        /* Enabled? */
+       mp_register_lapic(processor->id,        /* APIC ID */
+                         processor->flags.enabled);    /* Enabled? */
 
        return 0;
 }
 
 static int __init
-acpi_parse_lapic_addr_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+                         const unsigned long end)
 {
        struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;
 
-       lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr*) header;
+       lapic_addr_ovr = (struct acpi_table_lapic_addr_ovr *)header;
 
        if (BAD_MADT_ENTRY(lapic_addr_ovr, end))
                return -EINVAL;
@@ -284,12 +284,11 @@ acpi_parse_lapic_addr_ovr (
 }
 
 static int __init
-acpi_parse_lapic_nmi (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lapic_nmi *lapic_nmi = NULL;
 
-       lapic_nmi = (struct acpi_table_lapic_nmi*) header;
+       lapic_nmi = (struct acpi_table_lapic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lapic_nmi, end))
                return -EINVAL;
@@ -302,37 +301,32 @@ acpi_parse_lapic_nmi (
        return 0;
 }
 
-
-#endif /*CONFIG_X86_LOCAL_APIC*/
+#endif                         /*CONFIG_X86_LOCAL_APIC */
 
 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
 
 static int __init
-acpi_parse_ioapic (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_ioapic *ioapic = NULL;
 
-       ioapic = (struct acpi_table_ioapic*) header;
+       ioapic = (struct acpi_table_ioapic *)header;
 
        if (BAD_MADT_ENTRY(ioapic, end))
                return -EINVAL;
+
        acpi_table_print_madt_entry(header);
 
-       mp_register_ioapic (
-               ioapic->id,
-               ioapic->address,
-               ioapic->global_irq_base);
+       mp_register_ioapic(ioapic->id,
+                          ioapic->address, ioapic->global_irq_base);
+
        return 0;
 }
 
 /*
  * Parse Interrupt Source Override for the ACPI SCI
  */
-static void
-acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
+static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 {
        if (trigger == 0)       /* compatible SCI trigger is level */
                trigger = 3;
@@ -348,7 +342,7 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
                polarity = acpi_sci_flags.polarity;
 
        /*
-        * mp_config_acpi_legacy_irqs() already setup IRQs < 16
+        * mp_config_acpi_legacy_irqs() already setup IRQs < 16
         * If GSI is < 16, this will update its flags,
         * else it will create a new mp_irqs[] entry.
         */
@@ -363,12 +357,12 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
 }
 
 static int __init
-acpi_parse_int_src_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+                      const unsigned long end)
 {
        struct acpi_table_int_src_ovr *intsrc = NULL;
 
-       intsrc = (struct acpi_table_int_src_ovr*) header;
+       intsrc = (struct acpi_table_int_src_ovr *)header;
 
        if (BAD_MADT_ENTRY(intsrc, end))
                return -EINVAL;
@@ -377,33 +371,30 @@ acpi_parse_int_src_ovr (
 
        if (intsrc->bus_irq == acpi_fadt.sci_int) {
                acpi_sci_ioapic_setup(intsrc->global_irq,
-                       intsrc->flags.polarity, intsrc->flags.trigger);
+                                     intsrc->flags.polarity,
+                                     intsrc->flags.trigger);
                return 0;
        }
 
        if (acpi_skip_timer_override &&
-               intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
-                       printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
-                       return 0;
+           intsrc->bus_irq == 0 && intsrc->global_irq == 2) {
+               printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n");
+               return 0;
        }
 
-       mp_override_legacy_irq (
-               intsrc->bus_irq,
-               intsrc->flags.polarity,
-               intsrc->flags.trigger,
-               intsrc->global_irq);
+       mp_override_legacy_irq(intsrc->bus_irq,
+                              intsrc->flags.polarity,
+                              intsrc->flags.trigger, intsrc->global_irq);
 
        return 0;
 }
 
-
 static int __init
-acpi_parse_nmi_src (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_nmi_src *nmi_src = NULL;
 
-       nmi_src = (struct acpi_table_nmi_src*) header;
+       nmi_src = (struct acpi_table_nmi_src *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -415,7 +406,7 @@ acpi_parse_nmi_src (
        return 0;
 }
 
-#endif /* CONFIG_X86_IO_APIC */
+#endif                         /* CONFIG_X86_IO_APIC */
 
 #ifdef CONFIG_ACPI_BUS
 
@@ -433,8 +424,7 @@ acpi_parse_nmi_src (
  * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
  */
 
-void __init
-acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
+void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 {
        unsigned int mask = 1 << irq;
        unsigned int old, new;
@@ -454,10 +444,10 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
         * routing tables..
         */
        switch (trigger) {
-       case 1: /* Edge - clear */
+       case 1:         /* Edge - clear */
                new &= ~mask;
                break;
-       case 3: /* Level - set */
+       case 3:         /* Level - set */
                new |= mask;
                break;
        }
@@ -470,14 +460,13 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
        outb(new >> 8, 0x4d1);
 }
 
-
-#endif /* CONFIG_ACPI_BUS */
+#endif                         /* CONFIG_ACPI_BUS */
 
 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
 #ifdef CONFIG_X86_IO_APIC
        if (use_pci_vector() && !platform_legacy_irq(gsi))
-               *irq = IO_APIC_VECTOR(gsi);
+               *irq = IO_APIC_VECTOR(gsi);
        else
 #endif
                *irq = gsi;
@@ -501,7 +490,7 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
                extern void eisa_set_level_irq(unsigned int irq);
 
                if (edge_level == ACPI_LEVEL_SENSITIVE)
-                               eisa_set_level_irq(gsi);
+                       eisa_set_level_irq(gsi);
        }
 #endif
 
@@ -513,60 +502,58 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
        acpi_gsi_to_irq(plat_gsi, &irq);
        return irq;
 }
+
 EXPORT_SYMBOL(acpi_register_gsi);
 
 /*
  *  ACPI based hotplug support for CPU
  */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
-int
-acpi_map_lsapic(acpi_handle handle, int *pcpu)
+int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
        /* TBD */
        return -EINVAL;
 }
-EXPORT_SYMBOL(acpi_map_lsapic);
 
+EXPORT_SYMBOL(acpi_map_lsapic);
 
-int
-acpi_unmap_lsapic(int cpu)
+int acpi_unmap_lsapic(int cpu)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_unmap_lsapic);
-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+#endif                         /* CONFIG_ACPI_HOTPLUG_CPU */
 
-int
-acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
+int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_register_ioapic);
 
-int
-acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
+int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 {
        /* TBD */
        return -EINVAL;
 }
+
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
 static unsigned long __init
-acpi_scan_rsdp (
-       unsigned long           start,
-       unsigned long           length)
+acpi_scan_rsdp(unsigned long start, unsigned long length)
 {
-       unsigned long           offset = 0;
-       unsigned long           sig_len = sizeof("RSD PTR ") - 1;
+       unsigned long offset = 0;
+       unsigned long sig_len = sizeof("RSD PTR ") - 1;
 
        /*
         * Scan all 16-byte boundaries of the physical memory region for the
         * RSDP signature.
         */
        for (offset = 0; offset < length; offset += 16) {
-               if (strncmp((char *) (start + offset), "RSD PTR ", sig_len))
+               if (strncmp((char *)(start + offset), "RSD PTR ", sig_len))
                        continue;
                return (start + offset);
        }
@@ -579,20 +566,19 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
        struct acpi_table_sbf *sb;
 
        if (!phys_addr || !size)
-       return -EINVAL;
+               return -EINVAL;
 
-       sb = (struct acpi_table_sbf *) __acpi_map_table(phys_addr, size);
+       sb = (struct acpi_table_sbf *)__acpi_map_table(phys_addr, size);
        if (!sb) {
                printk(KERN_WARNING PREFIX "Unable to map SBF\n");
                return -ENODEV;
        }
 
-       sbf_port = sb->sbf_cmos; /* Save CMOS port */
+       sbf_port = sb->sbf_cmos;        /* Save CMOS port */
 
        return 0;
 }
 
-
 #ifdef CONFIG_HPET_TIMER
 
 static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
@@ -602,7 +588,7 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
        if (!phys || !size)
                return -EINVAL;
 
-       hpet_tbl = (struct acpi_table_hpet *) __acpi_map_table(phys, size);
+       hpet_tbl = (struct acpi_table_hpet *)__acpi_map_table(phys, size);
        if (!hpet_tbl) {
                printk(KERN_WARNING PREFIX "Unable to map HPET\n");
                return -ENODEV;
@@ -613,22 +599,21 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
                       "memory.\n");
                return -1;
        }
-
 #ifdef CONFIG_X86_64
-        vxtime.hpet_address = hpet_tbl->addr.addrl |
-                ((long) hpet_tbl->addr.addrh << 32);
+       vxtime.hpet_address = hpet_tbl->addr.addrl |
+           ((long)hpet_tbl->addr.addrh << 32);
 
-        printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-               hpet_tbl->id, vxtime.hpet_address);
-#else  /* X86 */
+       printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
+              hpet_tbl->id, vxtime.hpet_address);
+#else                          /* X86 */
        {
                extern unsigned long hpet_address;
 
                hpet_address = hpet_tbl->addr.addrl;
                printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
-                       hpet_tbl->id, hpet_address);
+                      hpet_tbl->id, hpet_address);
        }
-#endif /* X86 */
+#endif                         /* X86 */
 
        return 0;
 }
@@ -644,12 +629,11 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
 {
        struct fadt_descriptor_rev2 *fadt = NULL;
 
-       fadt = (struct fadt_descriptor_rev2*) __acpi_map_table(phys,size);
-       if(!fadt) {
+       fadt = (struct fadt_descriptor_rev2 *)__acpi_map_table(phys, size);
+       if (!fadt) {
                printk(KERN_WARNING PREFIX "Unable to map FADT\n");
                return 0;
        }
-
 #ifdef CONFIG_ACPI_INTERPRETER
        /* initialize sci_int early for INT_SRC_OVR MADT parsing */
        acpi_fadt.sci_int = fadt->sci_int;
@@ -658,14 +642,16 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
 #ifdef CONFIG_ACPI_BUS
        /* initialize rev and apic_phys_dest_mode for x86_64 genapic */
        acpi_fadt.revision = fadt->revision;
-       acpi_fadt.force_apic_physical_destination_mode = fadt->force_apic_physical_destination_mode;
+       acpi_fadt.force_apic_physical_destination_mode =
+           fadt->force_apic_physical_destination_mode;
 #endif
 
 #ifdef CONFIG_X86_PM_TIMER
        /* detect the location of the ACPI PM Timer */
        if (fadt->revision >= FADT2_REVISION_ID) {
                /* FADT rev. 2 */
-               if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
+               if (fadt->xpm_tmr_blk.address_space_id !=
+                   ACPI_ADR_SPACE_SYSTEM_IO)
                        return 0;
 
                pmtmr_ioport = fadt->xpm_tmr_blk.address;
@@ -674,16 +660,15 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
                pmtmr_ioport = fadt->V1_pm_tmr_blk;
        }
        if (pmtmr_ioport)
-               printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
+               printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
+                      pmtmr_ioport);
 #endif
        return 0;
 }
 
-
-unsigned long __init
-acpi_find_rsdp (void)
+unsigned long __init acpi_find_rsdp(void)
 {
-       unsigned long           rsdp_phys = 0;
+       unsigned long rsdp_phys = 0;
 
        if (efi_enabled) {
                if (efi.acpi20)
@@ -695,9 +680,9 @@ acpi_find_rsdp (void)
         * Scan memory looking for the RSDP signature. First search EBDA (low
         * memory) paragraphs and then search upper memory (E0000-FFFFF).
         */
-       rsdp_phys = acpi_scan_rsdp (0, 0x400);
+       rsdp_phys = acpi_scan_rsdp(0, 0x400);
        if (!rsdp_phys)
-               rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
+               rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000);
 
        return rsdp_phys;
 }
@@ -707,8 +692,7 @@ acpi_find_rsdp (void)
  * Parse LAPIC entries in MADT
  * returns 0 on success, < 0 on error
  */
-static int __init
-acpi_parse_madt_lapic_entries(void)
+static int __init acpi_parse_madt_lapic_entries(void)
 {
        int count;
 
@@ -717,28 +701,31 @@ acpi_parse_madt_lapic_entries(void)
         * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
         */
 
-       count = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR,
+                                 acpi_parse_lapic_addr_ovr, 0);
        if (count < 0) {
-               printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
+               printk(KERN_ERR PREFIX
+                      "Error parsing LAPIC address override entry\n");
                return count;
        }
 
        mp_register_lapic_address(acpi_lapic_addr);
 
        count = acpi_table_parse_madt(ACPI_MADT_LAPIC, acpi_parse_lapic,
-                                      MAX_APICS);
-       if (!count) { 
+                                     MAX_APICS);
+       if (!count) {
                printk(KERN_ERR PREFIX "No LAPIC entries present\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return -ENODEV;
-       }
-       else if (count < 0) {
+       } else if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return count;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
@@ -746,15 +733,14 @@ acpi_parse_madt_lapic_entries(void)
        }
        return 0;
 }
-#endif /* CONFIG_X86_LOCAL_APIC */
+#endif                         /* CONFIG_X86_LOCAL_APIC */
 
 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)
 /*
  * Parse IOAPIC related entries in MADT
  * returns 0 on success, < 0 on error
  */
-static int __init
-acpi_parse_madt_ioapic_entries(void)
+static int __init acpi_parse_madt_ioapic_entries(void)
 {
        int count;
 
@@ -766,30 +752,34 @@ acpi_parse_madt_ioapic_entries(void)
         */
        if (acpi_disabled || acpi_noirq) {
                return -ENODEV;
-        }
+       }
 
        /*
-        * if "noapic" boot option, don't look for IO-APICs
+        * if "noapic" boot option, don't look for IO-APICs
         */
        if (skip_ioapic_setup) {
                printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
-                       "due to 'noapic' option.\n");
+                      "due to 'noapic' option.\n");
                return -ENODEV;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic,
+                                 MAX_IO_APICS);
        if (!count) {
                printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
                return -ENODEV;
-       }
-       else if (count < 0) {
+       } else if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
                return count;
        }
 
-       count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr,
+                                 NR_IRQ_VECTORS);
        if (count < 0) {
-               printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
+               printk(KERN_ERR PREFIX
+                      "Error parsing interrupt source overrides entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
                return count;
        }
@@ -804,7 +794,9 @@ acpi_parse_madt_ioapic_entries(void)
        /* Fill in identity legacy mapings where no override */
        mp_config_acpi_legacy_irqs();
 
-       count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
+       count =
+           acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
+                                 NR_IRQ_VECTORS);
        if (count < 0) {
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
                /* TBD: Cleanup to allow fallback to MPS */
@@ -818,11 +810,9 @@ static inline int acpi_parse_madt_ioapic_entries(void)
 {
        return -1;
 }
-#endif /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */
-
+#endif                         /* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */
 
-static void __init
-acpi_process_madt(void)
+static void __init acpi_process_madt(void)
 {
 #ifdef CONFIG_X86_LOCAL_APIC
        int count, error;
@@ -854,7 +844,8 @@ acpi_process_madt(void)
                        /*
                         * Dell Precision Workstation 410, 610 come here.
                         */
-                       printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n");
+                       printk(KERN_ERR PREFIX
+                              "Invalid BIOS MADT, disabling ACPI\n");
                        disable_acpi();
                }
        }
@@ -891,7 +882,7 @@ static int __init disable_acpi_pci(struct dmi_system_id *d)
 static int __init dmi_disable_acpi(struct dmi_system_id *d)
 {
        if (!acpi_force) {
-               printk(KERN_NOTICE "%s detected: acpi off\n",d->ident);
+               printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
                disable_acpi();
        } else {
                printk(KERN_NOTICE
@@ -906,7 +897,8 @@ static int __init dmi_disable_acpi(struct dmi_system_id *d)
 static int __init force_acpi_ht(struct dmi_system_id *d)
 {
        if (!acpi_force) {
-               printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident);
+               printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
+                      d->ident);
                disable_acpi();
                acpi_ht = 1;
        } else {
@@ -925,155 +917,157 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
         * Boxes that need ACPI disabled
         */
        {
-               .callback = dmi_disable_acpi,
-               .ident = "IBM Thinkpad",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
-               },
-       },
+        .callback = dmi_disable_acpi,
+        .ident = "IBM Thinkpad",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "2629H1G"),
+                    },
+        },
 
        /*
         * Boxes that need acpi=ht
         */
        {
-               .callback = force_acpi_ht,
-               .ident = "FSC Primergy T850",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "FSC Primergy T850",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "DELL GX240",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
-                       DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "DELL GX240",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"),
+                    DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "HP VISUALIZE NT Workstation",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "HP VISUALIZE NT Workstation",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "HP VISUALIZE NT Workstation"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "Compaq Workstation W8000",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "Compaq Workstation W8000",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "Workstation W8000"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS P4B266",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS P4B266",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "P4B266"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS P2B-DS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS P2B-DS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "P2B-DS"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ASUS CUR-DLS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ASUS CUR-DLS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "CUR-DLS"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "ABIT i440BX-W83977",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
-                       DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "ABIT i440BX-W83977",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ABIT <http://www.abit.com>"),
+                    DMI_MATCH(DMI_BOARD_NAME, "i440BX-W83977 (BP6)"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM Bladecenter",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM Bladecenter",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "IBM eServer BladeCenter HS20"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eServer xSeries 360",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM eServer xSeries 360",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "eServer xSeries 360"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eserver xSeries 330",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM eserver xSeries 330",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_BOARD_NAME, "eserver xSeries 330"),
+                    },
+        },
        {
-               .callback = force_acpi_ht,
-               .ident = "IBM eserver xSeries 440",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
-               },
-       },
+        .callback = force_acpi_ht,
+        .ident = "IBM eserver xSeries 440",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "eserver xSeries 440"),
+                    },
+        },
 
 #ifdef CONFIG_ACPI_PCI
        /*
         * Boxes that need ACPI PCI IRQ routing disabled
         */
        {
-               .callback = disable_acpi_irq,
-               .ident = "ASUS A7V",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
-                       DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
-                       /* newer BIOS, Revision 1011, does work */
-                       DMI_MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
-               },
-       },
+        .callback = disable_acpi_irq,
+        .ident = "ASUS A7V",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
+                    DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
+                    /* newer BIOS, Revision 1011, does work */
+                    DMI_MATCH(DMI_BIOS_VERSION,
+                              "ASUS A7V ACPI BIOS Revision 1007"),
+                    },
+        },
 
        /*
         * Boxes that need ACPI PCI IRQ routing and PCI scan disabled
         */
-       {       /* _BBN 0 bug */
-               .callback = disable_acpi_pci,
-               .ident = "ASUS PR-DLS",
-               .matches = {
-                       DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
-                       DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
-                       DMI_MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS Revision 1010"),
-                       DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
-               },
-       },
+       {                       /* _BBN 0 bug */
+        .callback = disable_acpi_pci,
+        .ident = "ASUS PR-DLS",
+        .matches = {
+                    DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+                    DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
+                    DMI_MATCH(DMI_BIOS_VERSION,
+                              "ASUS PR-DLS ACPI BIOS Revision 1010"),
+                    DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
+                    },
+        },
        {
-               .callback = disable_acpi_pci,
-               .ident = "Acer TravelMate 36x Laptop",
-               .matches = {
-                       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-                       DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
-               },
-       },
+        .callback = disable_acpi_pci,
+        .ident = "Acer TravelMate 36x Laptop",
+        .matches = {
+                    DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+                    DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
+                    },
+        },
 #endif
-       { }
+       {}
 };
 
-#endif /* __i386__ */
+#endif                         /* __i386__ */
 
 /*
  * acpi_boot_table_init() and acpi_boot_init()
@@ -1098,8 +1092,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
  *     !0: failure
  */
 
-int __init
-acpi_boot_table_init(void)
+int __init acpi_boot_table_init(void)
 {
        int error;
 
@@ -1112,7 +1105,7 @@ acpi_boot_table_init(void)
         * One exception: acpi=ht continues far enough to enumerate LAPICs
         */
        if (acpi_disabled && !acpi_ht)
-                return 1;
+               return 1;
 
        /* 
         * Initialize the ACPI boot-time table parser.
@@ -1122,7 +1115,6 @@ acpi_boot_table_init(void)
                disable_acpi();
                return error;
        }
-
 #ifdef __i386__
        check_acpi_pci();
 #endif
@@ -1146,7 +1138,6 @@ acpi_boot_table_init(void)
        return 0;
 }
 
-
 int __init acpi_boot_init(void)
 {
        /*
@@ -1154,7 +1145,7 @@ int __init acpi_boot_init(void)
         * One exception: acpi=ht continues far enough to enumerate LAPICs
         */
        if (acpi_disabled && !acpi_ht)
-                return 1;
+               return 1;
 
        acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
 
@@ -1172,4 +1163,3 @@ int __init acpi_boot_init(void)
 
        return 0;
 }
-
index 726a5ca..f1b9d2a 100644 (file)
@@ -8,44 +8,44 @@
 #include <asm/pci-direct.h>
 #include <asm/acpi.h>
 
-static int __init check_bridge(int vendor, int device) 
+static int __init check_bridge(int vendor, int device)
 {
        /* According to Nvidia all timer overrides are bogus. Just ignore
           them all. */
-       if (vendor == PCI_VENDOR_ID_NVIDIA) { 
-               acpi_skip_timer_override = 1;           
+       if (vendor == PCI_VENDOR_ID_NVIDIA) {
+               acpi_skip_timer_override = 1;
        }
        return 0;
 }
-   
-void __init check_acpi_pci(void) 
-{ 
-       int num,slot,func; 
+
+void __init check_acpi_pci(void)
+{
+       int num, slot, func;
 
        /* Assume the machine supports type 1. If not it will 
           always read ffffffff and should not have any side effect. */
 
        /* Poor man's PCI discovery */
-       for (num = 0; num < 32; num++) { 
-               for (slot = 0; slot < 32; slot++) { 
-                       for (func = 0; func < 8; func++) { 
+       for (num = 0; num < 32; num++) {
+               for (slot = 0; slot < 32; slot++) {
+                       for (func = 0; func < 8; func++) {
                                u32 class;
                                u32 vendor;
-                               class = read_pci_config(num,slot,func,
+                               class = read_pci_config(num, slot, func,
                                                        PCI_CLASS_REVISION);
                                if (class == 0xffffffff)
-                                       break; 
+                                       break;
 
                                if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
-                                       continue; 
-                               
-                               vendor = read_pci_config(num, slot, func, 
+                                       continue;
+
+                               vendor = read_pci_config(num, slot, func,
                                                         PCI_VENDOR_ID);
-                               
-                               if (check_bridge(vendor&0xffff, vendor >> 16))
-                                       return; 
-                       } 
-                       
+
+                               if (check_bridge(vendor & 0xffff, vendor >> 16))
+                                       return;
+                       }
+
                }
        }
 }
index c1af930..1cb2b18 100644 (file)
@@ -20,12 +20,13 @@ extern void zap_low_mappings(void);
 
 extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
 
-static void init_low_mapping(pgd_t *pgd, int pgd_limit)
+static void init_low_mapping(pgd_t * pgd, int pgd_limit)
 {
        int pgd_ofs = 0;
 
-       while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
-               set_pgd(pgd, *(pgd+USER_PTRS_PER_PGD));
+       while ((pgd_ofs < pgd_limit)
+              && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
+               set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
                pgd_ofs++, pgd++;
        }
        flush_tlb_all();
@@ -37,12 +38,13 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  */
-int acpi_save_state_mem (void)
+int acpi_save_state_mem(void)
 {
        if (!acpi_wakeup_address)
                return 1;
        init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
-       memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
+       memcpy((void *)acpi_wakeup_address, &wakeup_start,
+              &wakeup_end - &wakeup_start);
        acpi_copy_wakeup_routine(acpi_wakeup_address);
 
        return 0;
@@ -51,7 +53,7 @@ int acpi_save_state_mem (void)
 /*
  * acpi_restore_state - undo effects of acpi_save_state_mem
  */
-void acpi_restore_state_mem (void)
+void acpi_restore_state_mem(void)
 {
        zap_low_mappings();
 }
@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void)
 void __init acpi_reserve_bootmem(void)
 {
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
-               printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n");
+               printk(KERN_ERR
+                      "ACPI: Wakeup code way too big, S3 disabled.\n");
                return;
        }
 
@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str)
        return 1;
 }
 
-
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-
 static __init int reset_videomode_after_s3(struct dmi_system_id *d)
 {
        acpi_video_flags |= 2;
@@ -101,14 +102,14 @@ static __init int reset_videomode_after_s3(struct dmi_system_id *d)
 }
 
 static __initdata struct dmi_system_id acpisleep_dmi_table[] = {
-       {       /* Reset video mode after returning from ACPI S3 sleep */
-               .callback = reset_videomode_after_s3,
-               .ident = "Toshiba Satellite 4030cdt",
-               .matches = {
-                       DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
-               },
-       },
-       { }
+       {                       /* Reset video mode after returning from ACPI S3 sleep */
+        .callback = reset_videomode_after_s3,
+        .ident = "Toshiba Satellite 4030cdt",
+        .matches = {
+                    DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),
+                    },
+        },
+       {}
 };
 
 static int __init acpisleep_dmi_init(void)
index 2623df5..13a5b3b 100644 (file)
 #include <asm/acpi-ext.h>
 
 struct acpi_vendor_descriptor {
-       u8                              guid_id;
-       efi_guid_t                      guid;
+       u8 guid_id;
+       efi_guid_t guid;
 };
 
 struct acpi_vendor_info {
-       struct acpi_vendor_descriptor   *descriptor;
-       u8                              *data;
-       u32                             length;
+       struct acpi_vendor_descriptor *descriptor;
+       u8 *data;
+       u32 length;
 };
 
 acpi_status
 acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
 {
-       struct acpi_vendor_info *info = (struct acpi_vendor_info *) context;
+       struct acpi_vendor_info *info = (struct acpi_vendor_info *)context;
        struct acpi_resource_vendor *vendor;
        struct acpi_vendor_descriptor *descriptor;
        u32 length;
@@ -38,8 +38,8 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
        if (resource->id != ACPI_RSTYPE_VENDOR)
                return AE_OK;
 
-       vendor = (struct acpi_resource_vendor *) &resource->data;
-       descriptor = (struct acpi_vendor_descriptor *) vendor->reserved;
+       vendor = (struct acpi_resource_vendor *)&resource->data;
+       descriptor = (struct acpi_vendor_descriptor *)vendor->reserved;
        if (vendor->length <= sizeof(*info->descriptor) ||
            descriptor->guid_id != info->descriptor->guid_id ||
            efi_guidcmp(descriptor->guid, info->descriptor->guid))
@@ -50,21 +50,24 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
        if (!info->data)
                return AE_NO_MEMORY;
 
-       memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length);
+       memcpy(info->data,
+              vendor->reserved + sizeof(struct acpi_vendor_descriptor),
+              length);
        info->length = length;
        return AE_CTRL_TERMINATE;
 }
 
 acpi_status
-acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
-               u8 **data, u32 *length)
+acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor * id,
+                         u8 ** data, u32 * length)
 {
        struct acpi_vendor_info info;
 
        info.descriptor = id;
        info.data = NULL;
 
-       acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info);
+       acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match,
+                           &info);
        if (!info.data)
                return AE_NOT_FOUND;
 
@@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
 
 struct acpi_vendor_descriptor hp_ccsr_descriptor = {
        .guid_id = 2,
-       .guid    = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
+       .guid =
+           EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
+                    0x37, 0x0e, 0xad)
 };
 
-acpi_status
-hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
+acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length)
 {
        acpi_status status;
        u8 *data;
        u32 length;
 
-       status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
+       status =
+           acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
 
        if (ACPI_FAILURE(status) || length != 16)
                return AE_NOT_FOUND;
index d362ecf..f3046bd 100644 (file)
@@ -74,12 +74,11 @@ unsigned int acpi_cpei_override;
 unsigned int acpi_cpei_phys_cpuid;
 
 #define MAX_SAPICS 256
-u16 ia64_acpiid_to_sapicid[MAX_SAPICS] =
-       { [0 ... MAX_SAPICS - 1] = -1 };
+u16 ia64_acpiid_to_sapicid[MAX_SAPICS] = {[0...MAX_SAPICS - 1] = -1 };
+
 EXPORT_SYMBOL(ia64_acpiid_to_sapicid);
 
-const char *
-acpi_get_sysname (void)
+const char *acpi_get_sysname(void)
 {
 #ifdef CONFIG_IA64_GENERIC
        unsigned long rsdp_phys;
@@ -89,27 +88,29 @@ acpi_get_sysname (void)
 
        rsdp_phys = acpi_find_rsdp();
        if (!rsdp_phys) {
-               printk(KERN_ERR "ACPI 2.0 RSDP not found, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 RSDP not found, default to \"dig\"\n");
                return "dig";
        }
 
-       rsdp = (struct acpi20_table_rsdp *) __va(rsdp_phys);
+       rsdp = (struct acpi20_table_rsdp *)__va(rsdp_phys);
        if (strncmp(rsdp->signature, RSDP_SIG, sizeof(RSDP_SIG) - 1)) {
-               printk(KERN_ERR "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 RSDP signature incorrect, default to \"dig\"\n");
                return "dig";
        }
 
-       xsdt = (struct acpi_table_xsdt *) __va(rsdp->xsdt_address);
+       xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_address);
        hdr = &xsdt->header;
        if (strncmp(hdr->signature, XSDT_SIG, sizeof(XSDT_SIG) - 1)) {
-               printk(KERN_ERR "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
+               printk(KERN_ERR
+                      "ACPI 2.0 XSDT signature incorrect, default to \"dig\"\n");
                return "dig";
        }
 
        if (!strcmp(hdr->oem_id, "HP")) {
                return "hpzx1";
-       }
-       else if (!strcmp(hdr->oem_id, "SGI")) {
+       } else if (!strcmp(hdr->oem_id, "SGI")) {
                return "sn2";
        }
 
@@ -137,7 +138,7 @@ acpi_get_sysname (void)
 
 /* Array to record platform interrupt vectors for generic interrupt routing. */
 int platform_intr_list[ACPI_MAX_PLATFORM_INTERRUPTS] = {
-       [0 ... ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1
+       [0...ACPI_MAX_PLATFORM_INTERRUPTS - 1] = -1
 };
 
 enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
@@ -146,8 +147,7 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_IOSAPIC;
  * Interrupt routing API for device drivers.  Provides interrupt vector for
  * a generic platform event.  Currently only CPEI is implemented.
  */
-int
-acpi_request_vector (u32 int_type)
+int acpi_request_vector(u32 int_type)
 {
        int vector = -1;
 
@@ -155,12 +155,12 @@ acpi_request_vector (u32 int_type)
                /* corrected platform error interrupt */
                vector = platform_intr_list[int_type];
        } else
-               printk(KERN_ERR "acpi_request_vector(): invalid interrupt type\n");
+               printk(KERN_ERR
+                      "acpi_request_vector(): invalid interrupt type\n");
        return vector;
 }
 
-char *
-__acpi_map_table (unsigned long phys_addr, unsigned long size)
+char *__acpi_map_table(unsigned long phys_addr, unsigned long size)
 {
        return __va(phys_addr);
 }
@@ -169,19 +169,18 @@ __acpi_map_table (unsigned long phys_addr, unsigned long size)
                             Boot-time Table Parsing
    -------------------------------------------------------------------------- */
 
-static int                     total_cpus __initdata;
-static int                     available_cpus __initdata;
-struct acpi_table_madt *       acpi_madt __initdata;
-static u8                      has_8259;
-
+static int total_cpus __initdata;
+static int available_cpus __initdata;
+struct acpi_table_madt *acpi_madt __initdata;
+static u8 has_8259;
 
 static int __init
-acpi_parse_lapic_addr_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
+                         const unsigned long end)
 {
        struct acpi_table_lapic_addr_ovr *lapic;
 
-       lapic = (struct acpi_table_lapic_addr_ovr *) header;
+       lapic = (struct acpi_table_lapic_addr_ovr *)header;
 
        if (BAD_MADT_ENTRY(lapic, end))
                return -EINVAL;
@@ -193,22 +192,23 @@ acpi_parse_lapic_addr_ovr (
        return 0;
 }
 
-
 static int __init
-acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lsapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lsapic *lsapic;
 
-       lsapic = (struct acpi_table_lsapic *) header;
+       lsapic = (struct acpi_table_lsapic *)header;
 
        if (BAD_MADT_ENTRY(lsapic, end))
                return -EINVAL;
 
        if (lsapic->flags.enabled) {
 #ifdef CONFIG_SMP
-               smp_boot_data.cpu_phys_id[available_cpus] = (lsapic->id << 8) | lsapic->eid;
+               smp_boot_data.cpu_phys_id[available_cpus] =
+                   (lsapic->id << 8) | lsapic->eid;
 #endif
-               ia64_acpiid_to_sapicid[lsapic->acpi_id] = (lsapic->id << 8) | lsapic->eid;
+               ia64_acpiid_to_sapicid[lsapic->acpi_id] =
+                   (lsapic->id << 8) | lsapic->eid;
                ++available_cpus;
        }
 
@@ -216,13 +216,12 @@ acpi_parse_lsapic (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-
 static int __init
-acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_lapic_nmi *lacpi_nmi;
 
-       lacpi_nmi = (struct acpi_table_lapic_nmi*) header;
+       lacpi_nmi = (struct acpi_table_lapic_nmi *)header;
 
        if (BAD_MADT_ENTRY(lacpi_nmi, end))
                return -EINVAL;
@@ -231,13 +230,12 @@ acpi_parse_lapic_nmi (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-
 static int __init
-acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_iosapic(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_iosapic *iosapic;
 
-       iosapic = (struct acpi_table_iosapic *) header;
+       iosapic = (struct acpi_table_iosapic *)header;
 
        if (BAD_MADT_ENTRY(iosapic, end))
                return -EINVAL;
@@ -245,15 +243,14 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
        return iosapic_init(iosapic->address, iosapic->global_irq_base);
 }
 
-
 static int __init
-acpi_parse_plat_int_src (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_plat_int_src(acpi_table_entry_header * header,
+                       const unsigned long end)
 {
        struct acpi_table_plat_int_src *plintsrc;
        int vector;
 
-       plintsrc = (struct acpi_table_plat_int_src *) header;
+       plintsrc = (struct acpi_table_plat_int_src *)header;
 
        if (BAD_MADT_ENTRY(plintsrc, end))
                return -EINVAL;
@@ -267,8 +264,12 @@ acpi_parse_plat_int_src (
                                                plintsrc->iosapic_vector,
                                                plintsrc->eid,
                                                plintsrc->id,
-                                               (plintsrc->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                                               (plintsrc->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                               (plintsrc->flags.polarity ==
+                                                1) ? IOSAPIC_POL_HIGH :
+                                               IOSAPIC_POL_LOW,
+                                               (plintsrc->flags.trigger ==
+                                                1) ? IOSAPIC_EDGE :
+                                               IOSAPIC_LEVEL);
 
        platform_intr_list[plintsrc->type] = vector;
        if (acpi_madt_rev > 1) {
@@ -283,7 +284,6 @@ acpi_parse_plat_int_src (
        return 0;
 }
 
-
 unsigned int can_cpei_retarget(void)
 {
        extern int cpe_vector;
@@ -322,29 +322,30 @@ unsigned int get_cpei_target_cpu(void)
 }
 
 static int __init
-acpi_parse_int_src_ovr (
-       acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_int_src_ovr(acpi_table_entry_header * header,
+                      const unsigned long end)
 {
        struct acpi_table_int_src_ovr *p;
 
-       p = (struct acpi_table_int_src_ovr *) header;
+       p = (struct acpi_table_int_src_ovr *)header;
 
        if (BAD_MADT_ENTRY(p, end))
                return -EINVAL;
 
        iosapic_override_isa_irq(p->bus_irq, p->global_irq,
-                                (p->flags.polarity == 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                                (p->flags.trigger == 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                (p->flags.polarity ==
+                                 1) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
+                                (p->flags.trigger ==
+                                 1) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
        return 0;
 }
 
-
 static int __init
-acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
+acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
 {
        struct acpi_table_nmi_src *nmi_src;
 
-       nmi_src = (struct acpi_table_nmi_src*) header;
+       nmi_src = (struct acpi_table_nmi_src *)header;
 
        if (BAD_MADT_ENTRY(nmi_src, end))
                return -EINVAL;
@@ -353,11 +354,9 @@ acpi_parse_nmi_src (acpi_table_entry_header *header, const unsigned long end)
        return 0;
 }
 
-static void __init
-acpi_madt_oem_check (char *oem_id, char *oem_table_id)
+static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 {
-       if (!strncmp(oem_id, "IBM", 3) &&
-           (!strncmp(oem_table_id, "SERMOW", 6))) {
+       if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERMOW", 6))) {
 
                /*
                 * Unfortunately ITC_DRIFT is not yet part of the
@@ -370,19 +369,18 @@ acpi_madt_oem_check (char *oem_id, char *oem_table_id)
        }
 }
 
-static int __init
-acpi_parse_madt (unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
 {
        if (!phys_addr || !size)
                return -EINVAL;
 
-       acpi_madt = (struct acpi_table_madt *) __va(phys_addr);
+       acpi_madt = (struct acpi_table_madt *)__va(phys_addr);
 
        acpi_madt_rev = acpi_madt->header.revision;
 
        /* remember the value for reference after free_initmem() */
 #ifdef CONFIG_ITANIUM
-       has_8259 = 1; /* Firmware on old Itanium systems is broken */
+       has_8259 = 1;           /* Firmware on old Itanium systems is broken */
 #else
        has_8259 = acpi_madt->flags.pcat_compat;
 #endif
@@ -396,19 +394,18 @@ acpi_parse_madt (unsigned long phys_addr, unsigned long size)
        printk(KERN_INFO PREFIX "Local APIC address %p\n", ipi_base_addr);
 
        acpi_madt_oem_check(acpi_madt->header.oem_id,
-               acpi_madt->header.oem_table_id);
+                           acpi_madt->header.oem_table_id);
 
        return 0;
 }
 
-
 #ifdef CONFIG_ACPI_NUMA
 
 #undef SLIT_DEBUG
 
 #define PXM_FLAG_LEN ((MAX_PXM_DOMAINS + 1)/32)
 
-static int __initdata srat_num_cpus;                   /* number of cpus */
+static int __initdata srat_num_cpus;   /* number of cpus */
 static u32 __devinitdata pxm_flag[PXM_FLAG_LEN];
 #define pxm_bit_set(bit)       (set_bit(bit,(void *)pxm_flag))
 #define pxm_bit_test(bit)      (test_bit(bit,(void *)pxm_flag))
@@ -421,15 +418,15 @@ static struct acpi_table_slit __initdata *slit_table;
  * ACPI 2.0 SLIT (System Locality Information Table)
  * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
  */
-void __init
-acpi_numa_slit_init (struct acpi_table_slit *slit)
+void __init acpi_numa_slit_init(struct acpi_table_slit *slit)
 {
        u32 len;
 
        len = sizeof(struct acpi_table_header) + 8
-               + slit->localities * slit->localities;
+           + slit->localities * slit->localities;
        if (slit->header.length != len) {
-               printk(KERN_ERR "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
+               printk(KERN_ERR
+                      "ACPI 2.0 SLIT: size mismatch: %d expected, %d actual\n",
                       len, slit->header.length);
                memset(numa_slit, 10, sizeof(numa_slit));
                return;
@@ -438,19 +435,20 @@ acpi_numa_slit_init (struct acpi_table_slit *slit)
 }
 
 void __init
-acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa)
+acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa)
 {
        /* record this node in proximity bitmap */
        pxm_bit_set(pa->proximity_domain);
 
-       node_cpuid[srat_num_cpus].phys_id = (pa->apic_id << 8) | (pa->lsapic_eid);
+       node_cpuid[srat_num_cpus].phys_id =
+           (pa->apic_id << 8) | (pa->lsapic_eid);
        /* nid should be overridden as logical node id later */
        node_cpuid[srat_num_cpus].nid = pa->proximity_domain;
        srat_num_cpus++;
 }
 
 void __init
-acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
+acpi_numa_memory_affinity_init(struct acpi_table_memory_affinity *ma)
 {
        unsigned long paddr, size;
        u8 pxm;
@@ -487,8 +485,7 @@ acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma)
        num_node_memblks++;
 }
 
-void __init
-acpi_numa_arch_fixup (void)
+void __init acpi_numa_arch_fixup(void)
 {
        int i, j, node_from, node_to;
 
@@ -534,21 +531,24 @@ acpi_numa_arch_fixup (void)
        for (i = 0; i < srat_num_cpus; i++)
                node_cpuid[i].nid = pxm_to_nid_map[node_cpuid[i].nid];
 
-       printk(KERN_INFO "Number of logical nodes in system = %d\n", num_online_nodes());
-       printk(KERN_INFO "Number of memory chunks in system = %d\n", num_node_memblks);
+       printk(KERN_INFO "Number of logical nodes in system = %d\n",
+              num_online_nodes());
+       printk(KERN_INFO "Number of memory chunks in system = %d\n",
+              num_node_memblks);
 
-       if (!slit_table) return;
+       if (!slit_table)
+               return;
        memset(numa_slit, -1, sizeof(numa_slit));
-       for (i=0; i<slit_table->localities; i++) {
+       for (i = 0; i < slit_table->localities; i++) {
                if (!pxm_bit_test(i))
                        continue;
                node_from = pxm_to_nid_map[i];
-               for (j=0; j<slit_table->localities; j++) {
+               for (j = 0; j < slit_table->localities; j++) {
                        if (!pxm_bit_test(j))
                                continue;
                        node_to = pxm_to_nid_map[j];
                        node_distance(node_from, node_to) =
-                               slit_table->entry[i*slit_table->localities + j];
+                           slit_table->entry[i * slit_table->localities + j];
                }
        }
 
@@ -556,40 +556,43 @@ acpi_numa_arch_fixup (void)
        printk("ACPI 2.0 SLIT locality table:\n");
        for_each_online_node(i) {
                for_each_online_node(j)
-                       printk("%03d ", node_distance(i,j));
+                   printk("%03d ", node_distance(i, j));
                printk("\n");
        }
 #endif
 }
-#endif /* CONFIG_ACPI_NUMA */
+#endif                         /* CONFIG_ACPI_NUMA */
 
 /*
  * success: return IRQ number (>=0)
  * failure: return < 0
  */
-int
-acpi_register_gsi (u32 gsi, int edge_level, int active_high_low)
+int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
 {
        if (has_8259 && gsi < 16)
                return isa_irq_to_vector(gsi);
 
        return iosapic_register_intr(gsi,
-                       (active_high_low == ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH : IOSAPIC_POL_LOW,
-                       (edge_level == ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE : IOSAPIC_LEVEL);
+                                    (active_high_low ==
+                                     ACPI_ACTIVE_HIGH) ? IOSAPIC_POL_HIGH :
+                                    IOSAPIC_POL_LOW,
+                                    (edge_level ==
+                                     ACPI_EDGE_SENSITIVE) ? IOSAPIC_EDGE :
+                                    IOSAPIC_LEVEL);
 }
+
 EXPORT_SYMBOL(acpi_register_gsi);
 
 #ifdef CONFIG_ACPI_DEALLOCATE_IRQ
-void
-acpi_unregister_gsi (u32 gsi)
+void acpi_unregister_gsi(u32 gsi)
 {
        iosapic_unregister_intr(gsi);
 }
+
 EXPORT_SYMBOL(acpi_unregister_gsi);
-#endif /* CONFIG_ACPI_DEALLOCATE_IRQ */
+#endif                         /* CONFIG_ACPI_DEALLOCATE_IRQ */
 
-static int __init
-acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
+static int __init acpi_parse_fadt(unsigned long phys_addr, unsigned long size)
 {
        struct acpi_table_header *fadt_header;
        struct fadt_descriptor_rev2 *fadt;
@@ -597,11 +600,11 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
        if (!phys_addr || !size)
                return -EINVAL;
 
-       fadt_header = (struct acpi_table_header *) __va(phys_addr);
+       fadt_header = (struct acpi_table_header *)__va(phys_addr);
        if (fadt_header->revision != 3)
-               return -ENODEV;         /* Only deal with ACPI 2.0 FADT */
+               return -ENODEV; /* Only deal with ACPI 2.0 FADT */
 
-       fadt = (struct fadt_descriptor_rev2 *) fadt_header;
+       fadt = (struct fadt_descriptor_rev2 *)fadt_header;
 
        if (!(fadt->iapc_boot_arch & BAF_8042_KEYBOARD_CONTROLLER))
                acpi_kbd_controller_present = 0;
@@ -613,22 +616,19 @@ acpi_parse_fadt (unsigned long phys_addr, unsigned long size)
        return 0;
 }
 
-
-unsigned long __init
-acpi_find_rsdp (void)
+unsigned long __init acpi_find_rsdp(void)
 {
        unsigned long rsdp_phys = 0;
 
        if (efi.acpi20)
                rsdp_phys = __pa(efi.acpi20);
        else if (efi.acpi)
-               printk(KERN_WARNING PREFIX "v1.0/r0.71 tables no longer supported\n");
+               printk(KERN_WARNING PREFIX
+                      "v1.0/r0.71 tables no longer supported\n");
        return rsdp_phys;
 }
 
-
-int __init
-acpi_boot_init (void)
+int __init acpi_boot_init(void)
 {
 
        /*
@@ -646,31 +646,43 @@ acpi_boot_init (void)
 
        /* Local APIC */
 
-       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
-               printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing LAPIC address override entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS) < 1)
-               printk(KERN_ERR PREFIX "Error parsing MADT - no LAPIC entries\n");
+       if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_parse_lsapic, NR_CPUS)
+           < 1)
+               printk(KERN_ERR PREFIX
+                      "Error parsing MADT - no LAPIC entries\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0) < 0)
+       if (acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0)
+           < 0)
                printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
 
        /* I/O APIC */
 
-       if (acpi_table_parse_madt(ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
-               printk(KERN_ERR PREFIX "Error parsing MADT - no IOSAPIC entries\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_IOSAPIC, acpi_parse_iosapic, NR_IOSAPICS) < 1)
+               printk(KERN_ERR PREFIX
+                      "Error parsing MADT - no IOSAPIC entries\n");
 
        /* System-Level Interrupt Routing */
 
-       if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src, ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
-               printk(KERN_ERR PREFIX "Error parsing platform interrupt source entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_PLAT_INT_SRC, acpi_parse_plat_int_src,
+            ACPI_MAX_PLATFORM_INTERRUPTS) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing platform interrupt source entry\n");
 
-       if (acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
-               printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
+       if (acpi_table_parse_madt
+           (ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, 0) < 0)
+               printk(KERN_ERR PREFIX
+                      "Error parsing interrupt source overrides entry\n");
 
        if (acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, 0) < 0)
                printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
-  skip_madt:
+      skip_madt:
 
        /*
         * FADT says whether a legacy keyboard controller is present.
@@ -685,8 +697,9 @@ acpi_boot_init (void)
        if (available_cpus == 0) {
                printk(KERN_INFO "ACPI: Found 0 CPUS; assuming 1\n");
                printk(KERN_INFO "CPU 0 (0x%04x)", hard_smp_processor_id());
-               smp_boot_data.cpu_phys_id[available_cpus] = hard_smp_processor_id();
-               available_cpus = 1; /* We've got at least one of these, no? */
+               smp_boot_data.cpu_phys_id[available_cpus] =
+                   hard_smp_processor_id();
+               available_cpus = 1;     /* We've got at least one of these, no? */
        }
        smp_boot_data.cpu_count = available_cpus;
 
@@ -695,8 +708,10 @@ acpi_boot_init (void)
        if (srat_num_cpus == 0) {
                int cpu, i = 1;
                for (cpu = 0; cpu < smp_boot_data.cpu_count; cpu++)
-                       if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
-                               node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
+                       if (smp_boot_data.cpu_phys_id[cpu] !=
+                           hard_smp_processor_id())
+                               node_cpuid[i++].phys_id =
+                                   smp_boot_data.cpu_phys_id[cpu];
        }
 # endif
 #endif
@@ -704,12 +719,12 @@ acpi_boot_init (void)
        build_cpu_to_node_map();
 #endif
        /* Make boot-up look pretty */
-       printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
+       printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus,
+              total_cpus);
        return 0;
 }
 
-int
-acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
+int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
 {
        int vector;
 
@@ -730,11 +745,10 @@ acpi_gsi_to_irq (u32 gsi, unsigned int *irq)
  */
 #ifdef CONFIG_ACPI_HOTPLUG_CPU
 static
-int
-acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
+int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
 {
 #ifdef CONFIG_ACPI_NUMA
-       int                     pxm_id;
+       int pxm_id;
 
        pxm_id = acpi_get_pxm(handle);
 
@@ -742,31 +756,28 @@ acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
         * Assuming that the container driver would have set the proximity
         * domain and would have initialized pxm_to_nid_map[pxm_id] && pxm_flag
         */
-       node_cpuid[cpu].nid = (pxm_id < 0) ? 0:
-                       pxm_to_nid_map[pxm_id];
+       node_cpuid[cpu].nid = (pxm_id < 0) ? 0 : pxm_to_nid_map[pxm_id];
 
-       node_cpuid[cpu].phys_id =  physid;
+       node_cpuid[cpu].phys_id = physid;
 #endif
-       return(0);
+       return (0);
 }
 
-
-int
-acpi_map_lsapic(acpi_handle handle, int *pcpu)
+int acpi_map_lsapic(acpi_handle handle, int *pcpu)
 {
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
        struct acpi_table_lsapic *lsapic;
        cpumask_t tmp_map;
        long physid;
        int cpu;
+
        if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
                return -EINVAL;
 
-       if (!buffer.length ||  !buffer.pointer)
+       if (!buffer.length || !buffer.pointer)
                return -EINVAL;
+
        obj = buffer.pointer;
        if (obj->type != ACPI_TYPE_BUFFER ||
            obj->buffer.length < sizeof(*lsapic)) {
@@ -782,7 +793,7 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu)
                return -EINVAL;
        }
 
-       physid = ((lsapic->id <<8) | (lsapic->eid));
+       physid = ((lsapic->id << 8) | (lsapic->eid));
 
        acpi_os_free(buffer.pointer);
        buffer.length = ACPI_ALLOCATE_BUFFER;
@@ -790,50 +801,49 @@ acpi_map_lsapic(acpi_handle handle, int *pcpu)
 
        cpus_complement(tmp_map, cpu_present_map);
        cpu = first_cpu(tmp_map);
-       if(cpu >= NR_CPUS)
+       if (cpu >= NR_CPUS)
                return -EINVAL;
 
        acpi_map_cpu2node(handle, cpu, physid);
 
-       cpu_set(cpu, cpu_present_map);
+       cpu_set(cpu, cpu_present_map);
        ia64_cpu_to_sapicid[cpu] = physid;
        ia64_acpiid_to_sapicid[lsapic->acpi_id] = ia64_cpu_to_sapicid[cpu];
 
        *pcpu = cpu;
-       return(0);
+       return (0);
 }
-EXPORT_SYMBOL(acpi_map_lsapic);
 
+EXPORT_SYMBOL(acpi_map_lsapic);
 
-int
-acpi_unmap_lsapic(int cpu)
+int acpi_unmap_lsapic(int cpu)
 {
        int i;
 
-       for (i=0; i<MAX_SAPICS; i++) {
-               if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
-                       ia64_acpiid_to_sapicid[i] = -1;
-                       break;
-               }
-       }
+       for (i = 0; i < MAX_SAPICS; i++) {
+               if (ia64_acpiid_to_sapicid[i] == ia64_cpu_to_sapicid[cpu]) {
+                       ia64_acpiid_to_sapicid[i] = -1;
+                       break;
+               }
+       }
        ia64_cpu_to_sapicid[cpu] = -1;
-       cpu_clear(cpu,cpu_present_map);
+       cpu_clear(cpu, cpu_present_map);
 
 #ifdef CONFIG_ACPI_NUMA
        /* NUMA specific cleanup's */
 #endif
 
-       return(0);
+       return (0);
 }
+
 EXPORT_SYMBOL(acpi_unmap_lsapic);
-#endif /* CONFIG_ACPI_HOTPLUG_CPU */
+#endif                         /* CONFIG_ACPI_HOTPLUG_CPU */
 
 #ifdef CONFIG_ACPI_NUMA
 acpi_status __devinit
-acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
+acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
 {
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        union acpi_object *obj;
        struct acpi_table_iosapic *iosapic;
        unsigned int gsi_base;
@@ -882,10 +892,9 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
        map_iosapic_to_node(gsi_base, node);
        return AE_OK;
 }
-#endif /* CONFIG_NUMA */
+#endif                         /* CONFIG_NUMA */
 
-int
-acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
+int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
 {
        int err;
 
@@ -894,17 +903,18 @@ acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
 
 #if CONFIG_ACPI_NUMA
        acpi_map_iosapic(handle, 0, NULL, NULL);
-#endif /* CONFIG_ACPI_NUMA */
+#endif                         /* CONFIG_ACPI_NUMA */
 
        return 0;
 }
+
 EXPORT_SYMBOL(acpi_register_ioapic);
 
-int
-acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
+int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
 {
        return iosapic_remove(gsi_base);
 }
+
 EXPORT_SYMBOL(acpi_unregister_ioapic);
 
-#endif /* CONFIG_ACPI_BOOT */
+#endif                         /* CONFIG_ACPI_BOOT */
index 7a275de..148f6f7 100644 (file)
@@ -47,7 +47,6 @@
 #include <asm/proto.h>
 #include <asm/tlbflush.h>
 
-
 /* --------------------------------------------------------------------------
                               Low-Level Sleep Support
    -------------------------------------------------------------------------- */
@@ -77,11 +76,12 @@ static void init_low_mapping(void)
  * Create an identity mapped page table and copy the wakeup routine to
  * low memory.
  */
-int acpi_save_state_mem (void)
+int acpi_save_state_mem(void)
 {
        init_low_mapping();
 
-       memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
+       memcpy((void *)acpi_wakeup_address, &wakeup_start,
+              &wakeup_end - &wakeup_start);
        acpi_copy_wakeup_routine(acpi_wakeup_address);
 
        return 0;
@@ -90,7 +90,7 @@ int acpi_save_state_mem (void)
 /*
  * acpi_restore_state
  */
-void acpi_restore_state_mem (void)
+void acpi_restore_state_mem(void)
 {
        set_pgd(pgd_offset(current->mm, 0UL), low_ptr);
        flush_tlb_all();
@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void)
 {
        acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
        if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
-               printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
+               printk(KERN_CRIT
+                      "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
 }
 
 static int __init acpi_sleep_setup(char *str)
@@ -127,6 +128,8 @@ static int __init acpi_sleep_setup(char *str)
 
 __setup("acpi_sleep=", acpi_sleep_setup);
 
-#endif /*CONFIG_ACPI_SLEEP*/
+#endif                         /*CONFIG_ACPI_SLEEP */
 
-void acpi_pci_link_exit(void) {}
+void acpi_pci_link_exit(void)
+{
+}
index 23ab761..7839b83 100644 (file)
@@ -32,7 +32,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_AC_COMPONENT              0x00020000
 #define ACPI_AC_CLASS                  "ac_adapter"
 #define ACPI_AC_HID                    "ACPI0003"
 #define ACPI_AC_STATUS_UNKNOWN         0xFF
 
 #define _COMPONENT             ACPI_AC_COMPONENT
-ACPI_MODULE_NAME               ("acpi_ac")
+ACPI_MODULE_NAME("acpi_ac")
 
-MODULE_AUTHOR("Paul Diefenbaugh");
+    MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-static int acpi_ac_add (struct acpi_device *device);
-static int acpi_ac_remove (struct acpi_device *device, int type);
+static int acpi_ac_add(struct acpi_device *device);
+static int acpi_ac_remove(struct acpi_device *device, int type);
 static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_ac_driver = {
-       .name =         ACPI_AC_DRIVER_NAME,
-       .class =        ACPI_AC_CLASS,
-       .ids =          ACPI_AC_HID,
-       .ops =          {
-                               .add =          acpi_ac_add,
-                               .remove =       acpi_ac_remove,
-                       },
+       .name = ACPI_AC_DRIVER_NAME,
+       .class = ACPI_AC_CLASS,
+       .ids = ACPI_AC_HID,
+       .ops = {
+               .add = acpi_ac_add,
+               .remove = acpi_ac_remove,
+               },
 };
 
 struct acpi_ac {
-       acpi_handle             handle;
-       unsigned long           state;
+       acpi_handle handle;
+       unsigned long state;
 };
 
 static struct file_operations acpi_ac_fops = {
-       .open           = acpi_ac_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_ac_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
 };
 
 /* --------------------------------------------------------------------------
                                AC Adapter Management
    -------------------------------------------------------------------------- */
 
-static int
-acpi_ac_get_state (
-       struct acpi_ac          *ac)
+static int acpi_ac_get_state(struct acpi_ac *ac)
 {
-       acpi_status             status = AE_OK;
+       acpi_status status = AE_OK;
 
        ACPI_FUNCTION_TRACE("acpi_ac_get_state");
 
@@ -95,24 +92,23 @@ acpi_ac_get_state (
        status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error reading AC Adapter state\n"));
+                                 "Error reading AC Adapter state\n"));
                ac->state = ACPI_AC_STATUS_UNKNOWN;
                return_VALUE(-ENODEV);
        }
-       
+
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-static struct proc_dir_entry   *acpi_ac_dir;
+static struct proc_dir_entry *acpi_ac_dir;
 
 static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_ac          *ac = (struct acpi_ac *) seq->private;
+       struct acpi_ac *ac = (struct acpi_ac *)seq->private;
 
        ACPI_FUNCTION_TRACE("acpi_ac_seq_show");
 
@@ -139,23 +135,21 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
 
        return_VALUE(0);
 }
-       
+
 static int acpi_ac_open_fs(struct inode *inode, struct file *file)
 {
        return single_open(file, acpi_ac_seq_show, PDE(inode)->data);
 }
 
-static int
-acpi_ac_add_fs (
-       struct acpi_device      *device)
+static int acpi_ac_add_fs(struct acpi_device *device)
 {
-       struct proc_dir_entry   *entry = NULL;
+       struct proc_dir_entry *entry = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
-                       acpi_ac_dir);
+                                                    acpi_ac_dir);
                if (!acpi_device_dir(device))
                        return_VALUE(-ENODEV);
                acpi_device_dir(device)->owner = THIS_MODULE;
@@ -163,11 +157,11 @@ acpi_ac_add_fs (
 
        /* 'state' [R] */
        entry = create_proc_entry(ACPI_AC_FILE_STATE,
-               S_IRUGO, acpi_device_dir(device));
+                                 S_IRUGO, acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_AC_FILE_STATE));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_AC_FILE_STATE));
        else {
                entry->proc_fops = &acpi_ac_fops;
                entry->data = acpi_driver_data(device);
@@ -177,16 +171,12 @@ acpi_ac_add_fs (
        return_VALUE(0);
 }
 
-
-static int
-acpi_ac_remove_fs (
-       struct acpi_device      *device)
+static int acpi_ac_remove_fs(struct acpi_device *device)
 {
        ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
 
        if (acpi_device_dir(device)) {
-               remove_proc_entry(ACPI_AC_FILE_STATE,
-                                 acpi_device_dir(device));
+               remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
 
                remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
                acpi_device_dir(device) = NULL;
@@ -195,19 +185,14 @@ acpi_ac_remove_fs (
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                                    Driver Model
    -------------------------------------------------------------------------- */
 
-static void
-acpi_ac_notify (
-       acpi_handle             handle,
-       u32                     event,
-       void                    *data)
+static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_ac          *ac = (struct acpi_ac *) data;
-       struct acpi_device      *device = NULL;
+       struct acpi_ac *ac = (struct acpi_ac *)data;
+       struct acpi_device *device = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_notify");
 
@@ -224,21 +209,18 @@ acpi_ac_notify (
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-
-static int
-acpi_ac_add (
-       struct acpi_device      *device)
+static int acpi_ac_add(struct acpi_device *device)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       struct acpi_ac          *ac = NULL;
+       int result = 0;
+       acpi_status status = AE_OK;
+       struct acpi_ac *ac = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_add");
 
@@ -264,19 +246,20 @@ acpi_ac_add (
                goto end;
 
        status = acpi_install_notify_handler(ac->handle,
-               ACPI_DEVICE_NOTIFY, acpi_ac_notify, ac);
+                                            ACPI_DEVICE_NOTIFY, acpi_ac_notify,
+                                            ac);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
 
-       printk(KERN_INFO PREFIX "%s [%s] (%s)\n", 
-               acpi_device_name(device), acpi_device_bid(device), 
-               ac->state?"on-line":"off-line");
+       printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
+              acpi_device_name(device), acpi_device_bid(device),
+              ac->state ? "on-line" : "off-line");
 
-end:
+      end:
        if (result) {
                acpi_ac_remove_fs(device);
                kfree(ac);
@@ -285,27 +268,23 @@ end:
        return_VALUE(result);
 }
 
-
-static int
-acpi_ac_remove (
-       struct acpi_device      *device,
-       int                     type)
+static int acpi_ac_remove(struct acpi_device *device, int type)
 {
-       acpi_status             status = AE_OK;
-       struct acpi_ac          *ac = NULL;
+       acpi_status status = AE_OK;
+       struct acpi_ac *ac = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_ac_remove");
 
        if (!device || !acpi_driver_data(device))
                return_VALUE(-EINVAL);
 
-       ac = (struct acpi_ac *) acpi_driver_data(device);
+       ac = (struct acpi_ac *)acpi_driver_data(device);
 
        status = acpi_remove_notify_handler(ac->handle,
-               ACPI_DEVICE_NOTIFY, acpi_ac_notify);
+                                           ACPI_DEVICE_NOTIFY, acpi_ac_notify);
        if (ACPI_FAILURE(status))
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
 
        acpi_ac_remove_fs(device);
 
@@ -314,11 +293,9 @@ acpi_ac_remove (
        return_VALUE(0);
 }
 
-
-static int __init
-acpi_ac_init (void)
+static int __init acpi_ac_init(void)
 {
-       int                     result = 0;
+       int result = 0;
 
        ACPI_FUNCTION_TRACE("acpi_ac_init");
 
@@ -336,9 +313,7 @@ acpi_ac_init (void)
        return_VALUE(0);
 }
 
-
-static void __exit
-acpi_ac_exit (void)
+static void __exit acpi_ac_exit(void)
 {
        ACPI_FUNCTION_TRACE("acpi_ac_exit");
 
@@ -349,6 +324,5 @@ acpi_ac_exit (void)
        return_VOID;
 }
 
-
 module_init(acpi_ac_init);
 module_exit(acpi_ac_exit);
index 77285ff..01a1bd2 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/memory_hotplug.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_MEMORY_DEVICE_COMPONENT           0x08000000UL
 #define ACPI_MEMORY_DEVICE_CLASS               "memory"
 #define ACPI_MEMORY_DEVICE_HID                 "PNP0C80"
@@ -41,8 +40,8 @@
 
 #define _COMPONENT             ACPI_MEMORY_DEVICE_COMPONENT
 
-ACPI_MODULE_NAME               ("acpi_memory")
-MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
+ACPI_MODULE_NAME("acpi_memory")
+    MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
 MODULE_DESCRIPTION(ACPI_MEMORY_DEVICE_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
@@ -56,34 +55,33 @@ MODULE_LICENSE("GPL");
 #define MEMORY_POWER_ON_STATE  1
 #define MEMORY_POWER_OFF_STATE 2
 
-static int acpi_memory_device_add (struct acpi_device *device);
-static int acpi_memory_device_remove (struct acpi_device *device, int type);
+static int acpi_memory_device_add(struct acpi_device *device);
+static int acpi_memory_device_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_memory_device_driver = {
-       .name =         ACPI_MEMORY_DEVICE_DRIVER_NAME,
-       .class =        ACPI_MEMORY_DEVICE_CLASS,
-       .ids =          ACPI_MEMORY_DEVICE_HID,
-       .ops =          {
-                               .add =          acpi_memory_device_add,
-                               .remove =       acpi_memory_device_remove,
-                       },
+       .name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
+       .class = ACPI_MEMORY_DEVICE_CLASS,
+       .ids = ACPI_MEMORY_DEVICE_HID,
+       .ops = {
+               .add = acpi_memory_device_add,
+               .remove = acpi_memory_device_remove,
+               },
 };
 
 struct acpi_memory_device {
        acpi_handle handle;
-       unsigned int state;             /* State of the memory device */
+       unsigned int state;     /* State of the memory device */
        unsigned short cache_attribute; /* memory cache attribute */
-       unsigned short read_write_attribute;/* memory read/write attribute */
-       u64 start_addr; /* Memory Range start physical addr */
-       u64 end_addr;   /* Memory Range end physical addr */
+       unsigned short read_write_attribute;    /* memory read/write attribute */
+       u64 start_addr;         /* Memory Range start physical addr */
+       u64 end_addr;           /* Memory Range end physical addr */
 };
 
-
 static int
 acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
 {
        acpi_status status;
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_resource *resource = NULL;
        struct acpi_resource_address64 address64;
 
@@ -94,15 +92,15 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
        if (ACPI_FAILURE(status))
                return_VALUE(-EINVAL);
 
-       resource = (struct acpi_resource *) buffer.pointer;
+       resource = (struct acpi_resource *)buffer.pointer;
        status = acpi_resource_to_address64(resource, &address64);
        if (ACPI_SUCCESS(status)) {
                if (address64.resource_type == ACPI_MEMORY_RANGE) {
                        /* Populate the structure */
                        mem_device->cache_attribute =
-                               address64.attribute.memory.cache_attribute;
+                           address64.attribute.memory.cache_attribute;
                        mem_device->read_write_attribute =
-                       address64.attribute.memory.read_write_attribute;
+                           address64.attribute.memory.read_write_attribute;
                        mem_device->start_addr = address64.min_address_range;
                        mem_device->end_addr = address64.max_address_range;
                }
@@ -114,7 +112,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
 
 static int
 acpi_memory_get_device(acpi_handle handle,
-       struct acpi_memory_device **mem_device)
+                      struct acpi_memory_device **mem_device)
 {
        acpi_status status;
        acpi_handle phandle;
@@ -128,8 +126,7 @@ acpi_memory_get_device(acpi_handle handle,
 
        status = acpi_get_parent(handle, &phandle);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_get_parent\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_get_parent\n"));
                return_VALUE(-EINVAL);
        }
 
@@ -137,7 +134,7 @@ acpi_memory_get_device(acpi_handle handle,
        status = acpi_bus_get_device(phandle, &pdevice);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_bus_get_device\n"));
+                                 "Error in acpi_bus_get_device\n"));
                return_VALUE(-EINVAL);
        }
 
@@ -147,23 +144,21 @@ acpi_memory_get_device(acpi_handle handle,
         */
        status = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error in acpi_bus_add\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error in acpi_bus_add\n"));
                return_VALUE(-EINVAL);
        }
 
-end:
+      end:
        *mem_device = acpi_driver_data(device);
        if (!(*mem_device)) {
-               printk(KERN_ERR "\n driver data not found" );
+               printk(KERN_ERR "\n driver data not found");
                return_VALUE(-ENODEV);
        }
 
        return_VALUE(0);
 }
 
-static int
-acpi_memory_check_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
 {
        unsigned long current_status;
 
@@ -171,22 +166,21 @@ acpi_memory_check_device(struct acpi_memory_device *mem_device)
 
        /* Get device present/absent information from the _STA */
        if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
-               NULL, &current_status)))
+                                              NULL, &current_status)))
                return_VALUE(-ENODEV);
        /*
         * Check for device status. Device should be
         * present/enabled/functioning.
         */
        if (!((current_status & ACPI_MEMORY_STA_PRESENT)
-               && (current_status & ACPI_MEMORY_STA_ENABLED)
-               && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
+             && (current_status & ACPI_MEMORY_STA_ENABLED)
+             && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
                return_VALUE(-ENODEV);
 
        return_VALUE(0);
 }
 
-static int
-acpi_memory_enable_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
        int result;
 
@@ -196,7 +190,7 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
        result = acpi_memory_get_device_resources(mem_device);
        if (result) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "\nget_device_resources failed\n"));
+                                 "\nget_device_resources failed\n"));
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
        }
@@ -206,11 +200,10 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
         * Note: Assume that this function returns zero on success
         */
        result = add_memory(mem_device->start_addr,
-                       (mem_device->end_addr - mem_device->start_addr) + 1,
-                       mem_device->read_write_attribute);
+                           (mem_device->end_addr - mem_device->start_addr) + 1,
+                           mem_device->read_write_attribute);
        if (result) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "\nadd_memory failed\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "\nadd_memory failed\n"));
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
        }
@@ -218,11 +211,10 @@ acpi_memory_enable_device(struct acpi_memory_device *mem_device)
        return result;
 }
 
-static int
-acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
 {
        acpi_status status;
-       struct acpi_object_list arg_list;
+       struct acpi_object_list arg_list;
        union acpi_object arg;
        unsigned long current_status;
 
@@ -234,16 +226,16 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        arg.type = ACPI_TYPE_INTEGER;
        arg.integer.value = 1;
        status = acpi_evaluate_object(mem_device->handle,
-                       "_EJ0", &arg_list, NULL);
+                                     "_EJ0", &arg_list, NULL);
        /* Return on _EJ0 failure */
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"_EJ0 failed.\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "_EJ0 failed.\n"));
                return_VALUE(-ENODEV);
        }
 
        /* Evalute _STA to check if the device is disabled */
        status = acpi_evaluate_integer(mem_device->handle, "_STA",
-               NULL, &current_status);
+                                      NULL, &current_status);
        if (ACPI_FAILURE(status))
                return_VALUE(-ENODEV);
 
@@ -254,8 +246,7 @@ acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        return_VALUE(0);
 }
 
-static int
-acpi_memory_disable_device(struct acpi_memory_device *mem_device)
+static int acpi_memory_disable_device(struct acpi_memory_device *mem_device)
 {
        int result;
        u64 start = mem_device->start_addr;
@@ -278,7 +269,7 @@ acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        result = acpi_memory_powerdown_device(mem_device);
        if (result) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Device Power Down failed.\n"));
+                                 "Device Power Down failed.\n"));
                /* Set the status of the device to invalid */
                mem_device->state = MEMORY_INVALID_STATE;
                return result;
@@ -288,8 +279,7 @@ acpi_memory_disable_device(struct acpi_memory_device *mem_device)
        return result;
 }
 
-static void
-acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
+static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 {
        struct acpi_memory_device *mem_device;
        struct acpi_device *device;
@@ -299,37 +289,37 @@ acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
        switch (event) {
        case ACPI_NOTIFY_BUS_CHECK:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived BUS CHECK notification for device\n"));
+                                 "\nReceived BUS CHECK notification for device\n"));
                /* Fall Through */
        case ACPI_NOTIFY_DEVICE_CHECK:
                if (event == ACPI_NOTIFY_DEVICE_CHECK)
                        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived DEVICE CHECK notification for device\n"));
+                                         "\nReceived DEVICE CHECK notification for device\n"));
                if (acpi_memory_get_device(handle, &mem_device)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in finding driver data\n"));
+                                         "Error in finding driver data\n"));
                        return_VOID;
                }
 
                if (!acpi_memory_check_device(mem_device)) {
                        if (acpi_memory_enable_device(mem_device))
                                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in acpi_memory_enable_device\n"));
+                                                 "Error in acpi_memory_enable_device\n"));
                }
                break;
        case ACPI_NOTIFY_EJECT_REQUEST:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "\nReceived EJECT REQUEST notification for device\n"));
+                                 "\nReceived EJECT REQUEST notification for device\n"));
 
                if (acpi_bus_get_device(handle, &device)) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Device doesn't exist\n"));
+                                         "Device doesn't exist\n"));
                        break;
                }
                mem_device = acpi_driver_data(device);
                if (!mem_device) {
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                       "Driver Data is NULL\n"));
+                                         "Driver Data is NULL\n"));
                        break;
                }
 
@@ -337,26 +327,25 @@ acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
                 * Currently disabling memory device from kernel mode
                 * TBD: Can also be disabled from user mode scripts
                 * TBD: Can also be disabled by Callback registration
-                *      with generic sysfs driver
+                *      with generic sysfs driver
                 */
                if (acpi_memory_disable_device(mem_device))
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in acpi_memory_disable_device\n"));
+                                         "Error in acpi_memory_disable_device\n"));
                /*
                 * TBD: Invoke acpi_bus_remove to cleanup data structures
                 */
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-static int
-acpi_memory_device_add(struct acpi_device *device)
+static int acpi_memory_device_add(struct acpi_device *device)
 {
        int result;
        struct acpi_memory_device *mem_device = NULL;
@@ -391,8 +380,7 @@ acpi_memory_device_add(struct acpi_device *device)
        return_VALUE(result);
 }
 
-static int
-acpi_memory_device_remove (struct acpi_device *device, int type)
+static int acpi_memory_device_remove(struct acpi_device *device, int type)
 {
        struct acpi_memory_device *mem_device = NULL;
 
@@ -401,7 +389,7 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
        if (!device || !acpi_driver_data(device))
                return_VALUE(-EINVAL);
 
-       mem_device = (struct acpi_memory_device *) acpi_driver_data(device);
+       mem_device = (struct acpi_memory_device *)acpi_driver_data(device);
        kfree(mem_device);
 
        return_VALUE(0);
@@ -410,12 +398,11 @@ acpi_memory_device_remove (struct acpi_device *device, int type)
 /*
  * Helper function to check for memory device
  */
-static acpi_status
-is_memory_device(acpi_handle handle)
+static acpi_status is_memory_device(acpi_handle handle)
 {
        char *hardware_id;
        acpi_status status;
-       struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_device_info *info;
 
        ACPI_FUNCTION_TRACE("is_memory_device");
@@ -432,7 +419,7 @@ is_memory_device(acpi_handle handle)
 
        hardware_id = info->hardware_id.value;
        if ((hardware_id == NULL) ||
-               (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
+           (strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
                status = AE_ERROR;
 
        acpi_os_free(buffer.pointer);
@@ -440,8 +427,8 @@ is_memory_device(acpi_handle handle)
 }
 
 static acpi_status
-acpi_memory_register_notify_handler (acpi_handle handle,
-       u32 level, void *ctxt, void **retv)
+acpi_memory_register_notify_handler(acpi_handle handle,
+                                   u32 level, void *ctxt, void **retv)
 {
        acpi_status status;
 
@@ -452,10 +439,10 @@ acpi_memory_register_notify_handler (acpi_handle handle,
                return_ACPI_STATUS(AE_OK);      /* continue */
 
        status = acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
-                       acpi_memory_device_notify, NULL);
+                                            acpi_memory_device_notify, NULL);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                return_ACPI_STATUS(AE_OK);      /* continue */
        }
 
@@ -463,8 +450,8 @@ acpi_memory_register_notify_handler (acpi_handle handle,
 }
 
 static acpi_status
-acpi_memory_deregister_notify_handler (acpi_handle handle,
-                              u32 level, void *ctxt, void **retv)
+acpi_memory_deregister_notify_handler(acpi_handle handle,
+                                     u32 level, void *ctxt, void **retv)
 {
        acpi_status status;
 
@@ -475,18 +462,18 @@ acpi_memory_deregister_notify_handler (acpi_handle handle,
                return_ACPI_STATUS(AE_OK);      /* continue */
 
        status = acpi_remove_notify_handler(handle,
-                       ACPI_SYSTEM_NOTIFY, acpi_memory_device_notify);
+                                           ACPI_SYSTEM_NOTIFY,
+                                           acpi_memory_device_notify);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
                return_ACPI_STATUS(AE_OK);      /* continue */
        }
 
        return_ACPI_STATUS(status);
 }
 
-static int __init
-acpi_memory_device_init (void)
+static int __init acpi_memory_device_init(void)
 {
        int result;
        acpi_status status;
@@ -499,21 +486,20 @@ acpi_memory_device_init (void)
                return_VALUE(-ENODEV);
 
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                               ACPI_UINT32_MAX,
-                               acpi_memory_register_notify_handler,
-                               NULL, NULL);
+                                    ACPI_UINT32_MAX,
+                                    acpi_memory_register_notify_handler,
+                                    NULL, NULL);
 
-       if (ACPI_FAILURE (status)) {
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+       if (ACPI_FAILURE(status)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
                acpi_bus_unregister_driver(&acpi_memory_device_driver);
                return_VALUE(-ENODEV);
-        }
+       }
 
        return_VALUE(0);
 }
 
-static void __exit
-acpi_memory_device_exit (void)
+static void __exit acpi_memory_device_exit(void)
 {
        acpi_status status;
 
@@ -524,12 +510,12 @@ acpi_memory_device_exit (void)
         * handles.
         */
        status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
-                       ACPI_UINT32_MAX,
-                       acpi_memory_deregister_notify_handler,
-                       NULL, NULL);
+                                    ACPI_UINT32_MAX,
+                                    acpi_memory_deregister_notify_handler,
+                                    NULL, NULL);
 
-       if (ACPI_FAILURE (status))
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "walk_namespace failed\n"));
+       if (ACPI_FAILURE(status))
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "walk_namespace failed\n"));
 
        acpi_bus_unregister_driver(&acpi_memory_device_driver);
 
@@ -538,5 +524,3 @@ acpi_memory_device_exit (void)
 
 module_init(acpi_memory_device_init);
 module_exit(acpi_memory_device_exit);
-
-
index a560b1e..fec895a 100644 (file)
@@ -61,7 +61,7 @@
 /*
  * Some events we use, same for all Asus
  */
-#define BR_UP       0x10               
+#define BR_UP       0x10
 #define BR_DOWN     0x20
 
 /*
@@ -75,7 +75,6 @@ MODULE_AUTHOR("Julien Lerouge, Karol Kozimor");
 MODULE_DESCRIPTION(ACPI_HOTK_NAME);
 MODULE_LICENSE("GPL");
 
-
 static uid_t asus_uid;
 static gid_t asus_gid;
 module_param(asus_uid, uint, 0);
@@ -83,26 +82,25 @@ MODULE_PARM_DESC(uid, "UID for entries in /proc/acpi/asus.\n");
 module_param(asus_gid, uint, 0);
 MODULE_PARM_DESC(gid, "GID for entries in /proc/acpi/asus.\n");
 
-
 /* For each model, all features implemented, 
  * those marked with R are relative to HOTK, A for absolute */
 struct model_data {
-       char *name;              //name of the laptop________________A
-       char *mt_mled;           //method to handle mled_____________R
-       char *mled_status;       //node to handle mled reading_______A
-       char *mt_wled;           //method to handle wled_____________R
-       char *wled_status;       //node to handle wled reading_______A
-       char *mt_tled;           //method to handle tled_____________R
-       char *tled_status;       //node to handle tled reading_______A
-       char *mt_lcd_switch;     //method to turn LCD ON/OFF_________A
-       char *lcd_status;        //node to read LCD panel state______A
-       char *brightness_up;     //method to set brightness up_______A
-       char *brightness_down;   //guess what ?______________________A
-       char *brightness_set;    //method to set absolute brightness_R
-       char *brightness_get;    //method to get absolute brightness_R
-       char *brightness_status; //node to get brightness____________A
-       char *display_set;       //method to set video output________R
-       char *display_get;       //method to get video output________R
+       char *name;             //name of the laptop________________A
+       char *mt_mled;          //method to handle mled_____________R
+       char *mled_status;      //node to handle mled reading_______A
+       char *mt_wled;          //method to handle wled_____________R
+       char *wled_status;      //node to handle wled reading_______A
+       char *mt_tled;          //method to handle tled_____________R
+       char *tled_status;      //node to handle tled reading_______A
+       char *mt_lcd_switch;    //method to turn LCD ON/OFF_________A
+       char *lcd_status;       //node to read LCD panel state______A
+       char *brightness_up;    //method to set brightness up_______A
+       char *brightness_down;  //guess what ?______________________A
+       char *brightness_set;   //method to set absolute brightness_R
+       char *brightness_get;   //method to get absolute brightness_R
+       char *brightness_status;        //node to get brightness____________A
+       char *display_set;      //method to set video output________R
+       char *display_get;      //method to get video output________R
 };
 
 /*
@@ -110,34 +108,34 @@ struct model_data {
  * about the hotk device
  */
 struct asus_hotk {
-       struct acpi_device *device; //the device we are in
-       acpi_handle handle;         //the handle of the hotk device
-       char status;                //status of the hotk, for LEDs, ...
-       struct model_data *methods; //methods available on the laptop
-       u8 brightness;              //brightness level
+       struct acpi_device *device;     //the device we are in
+       acpi_handle handle;     //the handle of the hotk device
+       char status;            //status of the hotk, for LEDs, ...
+       struct model_data *methods;     //methods available on the laptop
+       u8 brightness;          //brightness level
        enum {
-               A1x = 0,  //A1340D, A1300F
-               A2x,      //A2500H
-               D1x,      //D1
-               L2D,      //L2000D
-               L3C,      //L3800C
-               L3D,      //L3400D
-               L3H,      //L3H, but also L2000E
-               L4R,      //L4500R
-               L5x,      //L5800C 
-               L8L,      //L8400L
-               M1A,      //M1300A
-               M2E,      //M2400E, L4400L
-               M6N,      //M6800N
-               M6R,      //M6700R
-               P30,      //Samsung P30
-               S1x,      //S1300A, but also L1400B and M2400A (L84F)
-               S2x,      //S200 (J1 reported), Victor MP-XP7210
-               xxN,      //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
-                         //(Centrino)
+               A1x = 0,        //A1340D, A1300F
+               A2x,            //A2500H
+               D1x,            //D1
+               L2D,            //L2000D
+               L3C,            //L3800C
+               L3D,            //L3400D
+               L3H,            //L3H, but also L2000E
+               L4R,            //L4500R
+               L5x,            //L5800C 
+               L8L,            //L8400L
+               M1A,            //M1300A
+               M2E,            //M2400E, L4400L
+               M6N,            //M6800N
+               M6R,            //M6700R
+               P30,            //Samsung P30
+               S1x,            //S1300A, but also L1400B and M2400A (L84F)
+               S2x,            //S200 (J1 reported), Victor MP-XP7210
+               xxN,            //M2400N, M3700N, M5200N, S1300N, S5200N, W1OOON
+               //(Centrino)
                END_MODEL
-       } model;              //Models currently supported
-       u16 event_count[128]; //count for each event TODO make this better
+       } model;                //Models currently supported
+       u16 event_count[128];   //count for each event TODO make this better
 };
 
 /* Here we go */
@@ -150,7 +148,7 @@ struct asus_hotk {
 #define xxN_PREFIX "\\_SB.PCI0.SBRG.EC0."
 
 static struct model_data model_conf[END_MODEL] = {
-        /*
+       /*
         * Those pathnames are relative to the HOTK / ATKD device :
         *       - mt_mled
         *       - mt_wled
@@ -165,215 +163,197 @@ static struct model_data model_conf[END_MODEL] = {
         */
 
        {
-               .name              = "A1x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MAIL",
-               .mt_lcd_switch     = A1x_PREFIX "_Q10",
-               .lcd_status        = "\\BKLI",
-               .brightness_up     = A1x_PREFIX "_Q0E",
-               .brightness_down   = A1x_PREFIX "_Q0F"
-       },
+        .name = "A1x",
+        .mt_mled = "MLED",
+        .mled_status = "\\MAIL",
+        .mt_lcd_switch = A1x_PREFIX "_Q10",
+        .lcd_status = "\\BKLI",
+        .brightness_up = A1x_PREFIX "_Q0E",
+        .brightness_down = A1x_PREFIX "_Q0F"},
 
        {
-               .name              = "A2x",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\SG66",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\BAOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "A2x",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\SG66",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\BAOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "D1x",
-               .mt_mled           = "MLED",
-               .mt_lcd_switch     = "\\Q0D",
-               .lcd_status        = "\\GP11",
-               .brightness_up     = "\\Q0C",
-               .brightness_down   = "\\Q0B",
-               .brightness_status = "\\BLVL",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "D1x",
+        .mt_mled = "MLED",
+        .mt_lcd_switch = "\\Q0D",
+        .lcd_status = "\\GP11",
+        .brightness_up = "\\Q0C",
+        .brightness_down = "\\Q0B",
+        .brightness_status = "\\BLVL",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L2D",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\SGP6",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\RCP3",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\SGP0",
-               .brightness_up     = "\\Q0E",
-               .brightness_down   = "\\Q0F",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L2D",
+        .mt_mled = "MLED",
+        .mled_status = "\\SGP6",
+        .mt_wled = "WLED",
+        .wled_status = "\\RCP3",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\SGP0",
+        .brightness_up = "\\Q0E",
+        .brightness_down = "\\Q0F",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L3C",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = L3C_PREFIX "_Q10",
-               .lcd_status        = "\\GL32",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\_SB.PCI0.PCI1.VGAC.NMAP"
-       },
+        .name = "L3C",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = L3C_PREFIX "_Q10",
+        .lcd_status = "\\GL32",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\_SB.PCI0.PCI1.VGAC.NMAP"},
 
        {
-               .name              = "L3D",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MALD",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\BKLG",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L3D",
+        .mt_mled = "MLED",
+        .mled_status = "\\MALD",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\BKLG",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L3H",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "EHK",
-               .lcd_status        = "\\_SB.PCI0.PM.PBC",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "L3H",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "EHK",
+        .lcd_status = "\\_SB.PCI0.PM.PBC",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L4R",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\_SB.PCI0.SBRG.SG13",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.PCI0.SBSM.SEO4",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV", 
-               .display_set       = "SDSP",
-               .display_get       = "\\_SB.PCI0.P0P1.VGA.GETD"
-       },
+        .name = "L4R",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\_SB.PCI0.SBRG.SG13",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\_SB.PCI0.P0P1.VGA.GETD"},
 
        {
-               .name              = "L5x",
-               .mt_mled           = "MLED",
+        .name = "L5x",
+        .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
-               .mt_tled           = "TLED",
-               .mt_lcd_switch     = "\\Q0D",
-               .lcd_status        = "\\BAOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .mt_tled = "TLED",
+        .mt_lcd_switch = "\\Q0D",
+        .lcd_status = "\\BAOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "L8L"
+        .name = "L8L"
 /* No features, but at least support the hotkeys */
-       },
+        },
 
        {
-               .name              = "M1A",
-               .mt_mled           = "MLED",
-               .mt_lcd_switch     = M1A_PREFIX "Q10",
-               .lcd_status        = "\\PNOF",
-               .brightness_up     = M1A_PREFIX "Q0E",
-               .brightness_down   = M1A_PREFIX "Q0F",
-               .brightness_status = "\\BRIT",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "M1A",
+        .mt_mled = "MLED",
+        .mt_lcd_switch = M1A_PREFIX "Q10",
+        .lcd_status = "\\PNOF",
+        .brightness_up = M1A_PREFIX "Q0E",
+        .brightness_down = M1A_PREFIX "Q0F",
+        .brightness_status = "\\BRIT",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "M2E",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = "\\Q10",
-               .lcd_status        = "\\GP06",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\INFB"
-       },
+        .name = "M2E",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = "\\Q10",
+        .lcd_status = "\\GP06",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
 
        {
-               .name              = "M6N",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .wled_status       = "\\_SB.PCI0.SBRG.SG13",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.BKLT",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\SSTE"
-       },
+        .name = "M6N",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .wled_status = "\\_SB.PCI0.SBRG.SG13",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\SSTE"},
        {
-               .name              = "M6R",
-               .mt_mled           = "MLED",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\_SB.PCI0.SBSM.SEO4",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\SSTE"
-       },
-
+        .name = "M6R",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\_SB.PCI0.SBSM.SEO4",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\SSTE"},
 
        {
-               .name              = "P30",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = P30_PREFIX "_Q0E",
-               .lcd_status        = "\\BKLT",
-               .brightness_up     = P30_PREFIX "_Q68",
-               .brightness_down   = P30_PREFIX "_Q69",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\DNXT"
-       },
+        .name = "P30",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = P30_PREFIX "_Q0E",
+        .lcd_status = "\\BKLT",
+        .brightness_up = P30_PREFIX "_Q68",
+        .brightness_down = P30_PREFIX "_Q69",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\DNXT"},
 
        {
-               .name              = "S1x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\EMLE",
-               .mt_wled           = "WLED",
-               .mt_lcd_switch     = S1x_PREFIX "Q10" ,
-               .lcd_status        = "\\PNOF",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV"
-       },
+        .name = "S1x",
+        .mt_mled = "MLED",
+        .mled_status = "\\EMLE",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = S1x_PREFIX "Q10",
+        .lcd_status = "\\PNOF",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV"},
 
        {
-               .name              = "S2x",
-               .mt_mled           = "MLED",
-               .mled_status       = "\\MAIL",
-               .mt_lcd_switch     = S2x_PREFIX "_Q10",
-               .lcd_status        = "\\BKLI",
-               .brightness_up     = S2x_PREFIX "_Q0B",
-               .brightness_down   = S2x_PREFIX "_Q0A"
-       },
+        .name = "S2x",
+        .mt_mled = "MLED",
+        .mled_status = "\\MAIL",
+        .mt_lcd_switch = S2x_PREFIX "_Q10",
+        .lcd_status = "\\BKLI",
+        .brightness_up = S2x_PREFIX "_Q0B",
+        .brightness_down = S2x_PREFIX "_Q0A"},
 
        {
-               .name              = "xxN",
-               .mt_mled           = "MLED",
+        .name = "xxN",
+        .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
-               .mt_lcd_switch     = xxN_PREFIX "_Q10",
-               .lcd_status        = "\\BKLT",
-               .brightness_set    = "SPLV",
-               .brightness_get    = "GPLV",
-               .display_set       = "SDSP",
-               .display_get       = "\\ADVG"
-       }
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\ADVG"}
 };
 
 /* procdir we use */
@@ -395,13 +375,13 @@ static struct asus_hotk *hotk;
 static int asus_hotk_add(struct acpi_device *device);
 static int asus_hotk_remove(struct acpi_device *device, int type);
 static struct acpi_driver asus_hotk_driver = {
-       .name =         ACPI_HOTK_NAME,
-       .class =        ACPI_HOTK_CLASS,
-       .ids =          ACPI_HOTK_HID,
-       .ops =          {
-                               .add =          asus_hotk_add,
-                               .remove =       asus_hotk_remove,
-                       },
+       .name = ACPI_HOTK_NAME,
+       .class = ACPI_HOTK_CLASS,
+       .ids = ACPI_HOTK_HID,
+       .ops = {
+               .add = asus_hotk_add,
+               .remove = asus_hotk_remove,
+               },
 };
 
 /* 
@@ -423,11 +403,10 @@ static int write_acpi_int(acpi_handle handle, const char *method, int val,
        in_obj.type = ACPI_TYPE_INTEGER;
        in_obj.integer.value = val;
 
-       status = acpi_evaluate_object(handle, (char *) method, &params, output);
+       status = acpi_evaluate_object(handle, (char *)method, &params, output);
        return (status == AE_OK);
 }
 
-
 static int read_acpi_int(acpi_handle handle, const char *method, int *val)
 {
        struct acpi_buffer output;
@@ -437,7 +416,7 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val)
        output.length = sizeof(out_obj);
        output.pointer = &out_obj;
 
-       status = acpi_evaluate_object(handle, (char *) method, NULL, &output);
+       status = acpi_evaluate_object(handle, (char *)method, NULL, &output);
        *val = out_obj.integer.value;
        return (status == AE_OK) && (out_obj.type == ACPI_TYPE_INTEGER);
 }
@@ -449,7 +428,7 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val)
  */
 static int
 proc_read_info(char *page, char **start, off_t off, int count, int *eof,
-               void *data)
+              void *data)
 {
        int len = 0;
        int temp;
@@ -460,7 +439,7 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         */
 
        len += sprintf(page, ACPI_HOTK_NAME " " ASUS_ACPI_VERSION "\n");
-       len += sprintf(page + len, "Model reference    : %s\n", 
+       len += sprintf(page + len, "Model reference    : %s\n",
                       hotk->methods->name);
        /* 
         * The SFUN method probably allows the original driver to get the list 
@@ -469,7 +448,8 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         * The significance of others is yet to be found.
         */
        if (read_acpi_int(hotk->handle, "SFUN", &temp))
-               len += sprintf(page + len, "SFUN value         : 0x%04x\n", temp);
+               len +=
+                   sprintf(page + len, "SFUN value         : 0x%04x\n", temp);
        /*
         * Another value for userspace: the ASYM method returns 0x02 for
         * battery low and 0x04 for battery critical, its readings tend to be
@@ -478,7 +458,8 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
         * silently ignored.
         */
        if (read_acpi_int(hotk->handle, "ASYM", &temp))
-               len += sprintf(page + len, "ASYM value         : 0x%04x\n", temp);
+               len +=
+                   sprintf(page + len, "ASYM value         : 0x%04x\n", temp);
        if (asus_info) {
                snprintf(buf, 16, "%d", asus_info->length);
                len += sprintf(page + len, "DSDT length        : %s\n", buf);
@@ -501,7 +482,6 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
        return len;
 }
 
-
 /*
  * /proc handlers
  * We write our info in page, we begin at offset off and cannot write more
@@ -510,8 +490,7 @@ proc_read_info(char *page, char **start, off_t off, int count, int *eof,
  */
 
 /* Generic LED functions */
-static int
-read_led(const char *ledname, int ledmask)
+static int read_led(const char *ledname, int ledmask)
 {
        if (ledname) {
                int led_status;
@@ -525,7 +504,7 @@ read_led(const char *ledname, int ledmask)
        return (hotk->status & ledmask) ? 1 : 0;
 }
 
-static int parse_arg(const char __user *buf, unsigned long count, int *val)
+static int parse_arg(const char __user * buf, unsigned long count, int *val)
 {
        char s[32];
        if (!count)
@@ -542,8 +521,8 @@ static int parse_arg(const char __user *buf, unsigned long count, int *val)
 
 /* FIXME: kill extraneous args so it can be called independently */
 static int
-write_led(const char __user *buffer, unsigned long count,
-          char *ledname, int ledmask, int invert)
+write_led(const char __user * buffer, unsigned long count,
+         char *ledname, int ledmask, int invert)
 {
        int value;
        int led_out = 0;
@@ -555,16 +534,16 @@ write_led(const char __user *buffer, unsigned long count,
        hotk->status =
            (led_out) ? (hotk->status | ledmask) : (hotk->status & ~ledmask);
 
-       if (invert) /* invert target value */
+       if (invert)             /* invert target value */
                led_out = !led_out & 0x1;
 
        if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
-               printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", ledname);
+               printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
+                      ledname);
 
        return count;
 }
 
-
 /*
  * Proc handlers for MLED
  */
@@ -572,12 +551,12 @@ static int
 proc_read_mled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->mled_status, MLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->mled_status, MLED_ON));
 }
 
-
 static int
-proc_write_mled(struct file *file, const char __user *buffer,
+proc_write_mled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_mled, MLED_ON, 1);
@@ -590,11 +569,12 @@ static int
 proc_read_wled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->wled_status, WLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->wled_status, WLED_ON));
 }
 
 static int
-proc_write_wled(struct file *file, const char __user *buffer,
+proc_write_wled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_wled, WLED_ON, 0);
@@ -607,35 +587,36 @@ static int
 proc_read_tled(char *page, char **start, off_t off, int count, int *eof,
               void *data)
 {
-       return sprintf(page, "%d\n", read_led(hotk->methods->tled_status, TLED_ON));
+       return sprintf(page, "%d\n",
+                      read_led(hotk->methods->tled_status, TLED_ON));
 }
 
 static int
-proc_write_tled(struct file *file, const char __user *buffer,
+proc_write_tled(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
        return write_led(buffer, count, hotk->methods->mt_tled, TLED_ON, 0);
 }
 
-
 static int get_lcd_state(void)
 {
        int lcd = 0;
 
        if (hotk->model != L3H) {
-       /* We don't have to check anything if we are here */
+               /* We don't have to check anything if we are here */
                if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
-                       printk(KERN_WARNING "Asus ACPI: Error reading LCD status\n");
-       
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading LCD status\n");
+
                if (hotk->model == L2D)
                        lcd = ~lcd;
-       } else { /* L3H and the like have to be handled differently */
+       } else {                /* L3H and the like have to be handled differently */
                acpi_status status = 0;
                struct acpi_object_list input;
                union acpi_object mt_params[2];
                struct acpi_buffer output;
                union acpi_object out_obj;
-               
+
                input.count = 2;
                input.pointer = mt_params;
                /* Note: the following values are partly guessed up, but 
@@ -647,15 +628,17 @@ static int get_lcd_state(void)
 
                output.length = sizeof(out_obj);
                output.pointer = &out_obj;
-               
-               status = acpi_evaluate_object(NULL, hotk->methods->lcd_status, &input, &output);
+
+               status =
+                   acpi_evaluate_object(NULL, hotk->methods->lcd_status,
+                                        &input, &output);
                if (status != AE_OK)
                        return -1;
                if (out_obj.type == ACPI_TYPE_INTEGER)
                        /* That's what the AML code does */
                        lcd = out_obj.integer.value >> 8;
        }
-       
+
        return (lcd & 1);
 }
 
@@ -669,10 +652,13 @@ static int set_lcd_state(int value)
                /* switch */
                if (hotk->model != L3H) {
                        status =
-                           acpi_evaluate_object(NULL, hotk->methods->mt_lcd_switch,
+                           acpi_evaluate_object(NULL,
+                                                hotk->methods->mt_lcd_switch,
                                                 NULL, NULL);
-               } else { /* L3H and the like have to be handled differently */
-                       if (!write_acpi_int(hotk->handle, hotk->methods->mt_lcd_switch, 0x07, NULL))
+               } else {        /* L3H and the like have to be handled differently */
+                       if (!write_acpi_int
+                           (hotk->handle, hotk->methods->mt_lcd_switch, 0x07,
+                            NULL))
                                status = AE_ERROR;
                        /* L3H's AML executes EHK (0x07) upon Fn+F7 keypress, 
                           the exact behaviour is simulated here */
@@ -691,33 +677,33 @@ proc_read_lcd(char *page, char **start, off_t off, int count, int *eof,
        return sprintf(page, "%d\n", get_lcd_state());
 }
 
-
 static int
-proc_write_lcd(struct file *file, const char __user *buffer,
+proc_write_lcd(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
        int value;
-       
+
        count = parse_arg(buffer, count, &value);
        if (count > 0)
                set_lcd_state(value);
        return count;
 }
 
-
 static int read_brightness(void)
 {
        int value;
-       
-       if(hotk->methods->brightness_get) { /* SPLV/GPLV laptop */
-               if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, 
+
+       if (hotk->methods->brightness_get) {    /* SPLV/GPLV laptop */
+               if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
                                   &value))
-                       printk(KERN_WARNING "Asus ACPI: Error reading brightness\n");
-       } else if (hotk->methods->brightness_status) { /* For D1 for example */
-               if (!read_acpi_int(NULL, hotk->methods->brightness_status, 
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading brightness\n");
+       } else if (hotk->methods->brightness_status) {  /* For D1 for example */
+               if (!read_acpi_int(NULL, hotk->methods->brightness_status,
                                   &value))
-                       printk(KERN_WARNING "Asus ACPI: Error reading brightness\n");
-       } else /* No GPLV method */
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error reading brightness\n");
+       } else                  /* No GPLV method */
                value = hotk->brightness;
        return value;
 }
@@ -730,23 +716,25 @@ static void set_brightness(int value)
        acpi_status status = 0;
 
        /* SPLV laptop */
-       if(hotk->methods->brightness_set) {
-               if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set, 
+       if (hotk->methods->brightness_set) {
+               if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
                                    value, NULL))
-                       printk(KERN_WARNING "Asus ACPI: Error changing brightness\n");
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error changing brightness\n");
                return;
        }
 
        /* No SPLV method if we are here, act as appropriate */
        value -= read_brightness();
        while (value != 0) {
-               status = acpi_evaluate_object(NULL, (value > 0) ? 
-                                             hotk->methods->brightness_up : 
+               status = acpi_evaluate_object(NULL, (value > 0) ?
+                                             hotk->methods->brightness_up :
                                              hotk->methods->brightness_down,
                                              NULL, NULL);
                (value > 0) ? value-- : value++;
                if (ACPI_FAILURE(status))
-                       printk(KERN_WARNING "Asus ACPI: Error changing brightness\n");
+                       printk(KERN_WARNING
+                              "Asus ACPI: Error changing brightness\n");
        }
        return;
 }
@@ -759,7 +747,7 @@ proc_read_brn(char *page, char **start, off_t off, int count, int *eof,
 }
 
 static int
-proc_write_brn(struct file *file, const char __user *buffer,
+proc_write_brn(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
        int value;
@@ -767,7 +755,7 @@ proc_write_brn(struct file *file, const char __user *buffer,
        count = parse_arg(buffer, count, &value);
        if (count > 0) {
                value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
-                       /* 0 <= value <= 15 */
+               /* 0 <= value <= 15 */
                set_brightness(value);
        } else if (count < 0) {
                printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
@@ -779,7 +767,7 @@ proc_write_brn(struct file *file, const char __user *buffer,
 static void set_display(int value)
 {
        /* no sanity check needed for now */
-       if (!write_acpi_int(hotk->handle, hotk->methods->display_set, 
+       if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
                            value, NULL))
                printk(KERN_WARNING "Asus ACPI: Error setting display\n");
        return;
@@ -791,13 +779,14 @@ static void set_display(int value)
  */
 static int
 proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
-             void *data)
+              void *data)
 {
        int value = 0;
-       
+
        if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
-               printk(KERN_WARNING "Asus ACPI: Error reading display status\n");
-       value &= 0x07; /* needed for some models, shouldn't hurt others */
+               printk(KERN_WARNING
+                      "Asus ACPI: Error reading display status\n");
+       value &= 0x07;          /* needed for some models, shouldn't hurt others */
        return sprintf(page, "%d\n", value);
 }
 
@@ -808,8 +797,8 @@ proc_read_disp(char *page, char **start, off_t off, int count, int *eof,
  * simultaneously, so be warned. See the acpi4asus README for more info.
  */
 static int
-proc_write_disp(struct file *file, const char __user *buffer,
-              unsigned long count, void *data)
+proc_write_disp(struct file *file, const char __user * buffer,
+               unsigned long count, void *data)
 {
        int value;
 
@@ -822,19 +811,19 @@ proc_write_disp(struct file *file, const char __user *buffer,
        return count;
 }
 
-
-typedef int (proc_readfunc)(char *page, char **start, off_t off, int count,
-                            int *eof, void *data);
-typedef int (proc_writefunc)(struct file *file, const char __user *buffer,
-                             unsigned long count, void *data);
+typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
+                            int *eof, void *data);
+typedef int (proc_writefunc) (struct file * file, const char __user * buffer,
+                             unsigned long count, void *data);
 
 static int
-__init asus_proc_add(char *name, proc_writefunc *writefunc,
-                    proc_readfunc *readfunc, mode_t mode,
-                    struct acpi_device *device)
+__init asus_proc_add(char *name, proc_writefunc * writefunc,
+                    proc_readfunc * readfunc, mode_t mode,
+                    struct acpi_device *device)
 {
-       struct proc_dir_entry *proc = create_proc_entry(name, mode, acpi_device_dir(device));
-       if(!proc) {
+       struct proc_dir_entry *proc =
+           create_proc_entry(name, mode, acpi_device_dir(device));
+       if (!proc) {
                printk(KERN_WARNING "  Unable to create %s fs entry\n", name);
                return -1;
        }
@@ -851,14 +840,14 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
 {
        struct proc_dir_entry *proc;
        mode_t mode;
-       
+
        /*
         * If parameter uid or gid is not changed, keep the default setting for
         * our proc entries (-rw-rw-rw-) else, it means we care about security,
         * and then set to -rw-rw----
         */
 
-       if ((asus_uid == 0) && (asus_gid == 0)){
+       if ((asus_uid == 0) && (asus_gid == 0)) {
                mode = S_IFREG | S_IRUGO | S_IWUGO;
        } else {
                mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
@@ -881,15 +870,18 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
        }
 
        if (hotk->methods->mt_wled) {
-               asus_proc_add(PROC_WLED, &proc_write_wled, &proc_read_wled, mode, device);
+               asus_proc_add(PROC_WLED, &proc_write_wled, &proc_read_wled,
+                             mode, device);
        }
 
        if (hotk->methods->mt_mled) {
-               asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled, mode, device);
+               asus_proc_add(PROC_MLED, &proc_write_mled, &proc_read_mled,
+                             mode, device);
        }
 
        if (hotk->methods->mt_tled) {
-               asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled, mode, device);
+               asus_proc_add(PROC_TLED, &proc_write_tled, &proc_read_tled,
+                             mode, device);
        }
 
        /* 
@@ -897,35 +889,40 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
         * from keyboard 
         */
        if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status) {
-               asus_proc_add(PROC_LCD, &proc_write_lcd, &proc_read_lcd, mode, device);
+               asus_proc_add(PROC_LCD, &proc_write_lcd, &proc_read_lcd, mode,
+                             device);
        }
-       
+
        if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
            (hotk->methods->brightness_get && hotk->methods->brightness_set)) {
-               asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode, device);
+               asus_proc_add(PROC_BRN, &proc_write_brn, &proc_read_brn, mode,
+                             device);
        }
 
        if (hotk->methods->display_set) {
-               asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp, mode, device);
+               asus_proc_add(PROC_DISP, &proc_write_disp, &proc_read_disp,
+                             mode, device);
        }
 
        return 0;
 }
 
-static int asus_hotk_remove_fs(struct acpi_device* device)
+static int asus_hotk_remove_fs(struct acpi_device *device)
 {
-       if(acpi_device_dir(device)) {
-               remove_proc_entry(PROC_INFO,acpi_device_dir(device));
+       if (acpi_device_dir(device)) {
+               remove_proc_entry(PROC_INFO, acpi_device_dir(device));
                if (hotk->methods->mt_wled)
-                       remove_proc_entry(PROC_WLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_WLED, acpi_device_dir(device));
                if (hotk->methods->mt_mled)
-                       remove_proc_entry(PROC_MLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_MLED, acpi_device_dir(device));
                if (hotk->methods->mt_tled)
-                       remove_proc_entry(PROC_TLED,acpi_device_dir(device));
+                       remove_proc_entry(PROC_TLED, acpi_device_dir(device));
                if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
                        remove_proc_entry(PROC_LCD, acpi_device_dir(device));
-               if ((hotk->methods->brightness_up && hotk->methods->brightness_down) ||
-                   (hotk->methods->brightness_get && hotk->methods->brightness_set))
+               if ((hotk->methods->brightness_up
+                    && hotk->methods->brightness_down)
+                   || (hotk->methods->brightness_get
+                       && hotk->methods->brightness_set))
                        remove_proc_entry(PROC_BRN, acpi_device_dir(device));
                if (hotk->methods->display_set)
                        remove_proc_entry(PROC_DISP, acpi_device_dir(device));
@@ -933,16 +930,15 @@ static int asus_hotk_remove_fs(struct acpi_device* device)
        return 0;
 }
 
-
 static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
 {
-       /* TODO Find a better way to handle events count.*/
+       /* TODO Find a better way to handle events count. */
        if (!hotk)
                return;
 
        if ((event & ~((u32) BR_UP)) < 16) {
                hotk->brightness = (event & ~((u32) BR_UP));
-       } else if ((event & ~((u32) BR_DOWN)) < 16 ) {
+       } else if ((event & ~((u32) BR_DOWN)) < 16) {
                hotk->brightness = (event & ~((u32) BR_DOWN));
        }
 
@@ -976,7 +972,7 @@ static int __init asus_hotk_get_info(void)
        if (ACPI_FAILURE(status))
                printk(KERN_WARNING "  Couldn't get the DSDT table header\n");
        else
-               asus_info = (struct acpi_table_header *) dsdt.pointer;
+               asus_info = (struct acpi_table_header *)dsdt.pointer;
 
        /* We have to write 0 on init this far for all ASUS models */
        if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
@@ -988,15 +984,17 @@ static int __init asus_hotk_get_info(void)
        if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
                printk(KERN_WARNING "  Error calling BSTS\n");
        else if (bsts_result)
-               printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n", bsts_result);
+               printk(KERN_NOTICE "  BSTS called, 0x%02x returned\n",
+                      bsts_result);
 
        /* Samsung P30 has a device with a valid _HID whose INIT does not 
         * return anything. Catch this one and any similar here */
        if (buffer.pointer == NULL) {
-               if (asus_info && /* Samsung P30 */
+               if (asus_info &&        /* Samsung P30 */
                    strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
                        hotk->model = P30;
-                       printk(KERN_NOTICE "  Samsung P30 detected, supported\n");
+                       printk(KERN_NOTICE
+                              "  Samsung P30 detected, supported\n");
                } else {
                        hotk->model = M2E;
                        printk(KERN_WARNING "  no string returned by INIT\n");
@@ -1006,10 +1004,11 @@ static int __init asus_hotk_get_info(void)
                hotk->methods = &model_conf[hotk->model];
                return AE_OK;
        }
-       
-       model = (union acpi_object *) buffer.pointer;
+
+       model = (union acpi_object *)buffer.pointer;
        if (model->type == ACPI_TYPE_STRING) {
-               printk(KERN_NOTICE "  %s model detected, ", model->string.pointer);
+               printk(KERN_NOTICE "  %s model detected, ",
+                      model->string.pointer);
        }
 
        hotk->model = END_MODEL;
@@ -1035,7 +1034,7 @@ static int __init asus_hotk_get_info(void)
                 strncmp(model->string.pointer, "M6N", 3) == 0 ||
                 strncmp(model->string.pointer, "S1N", 3) == 0 ||
                 strncmp(model->string.pointer, "S5N", 3) == 0 ||
-                 strncmp(model->string.pointer, "W1N", 3) == 0)
+                strncmp(model->string.pointer, "W1N", 3) == 0)
                hotk->model = xxN;
        else if (strncmp(model->string.pointer, "M1", 2) == 0)
                hotk->model = M1A;
@@ -1069,21 +1068,21 @@ static int __init asus_hotk_get_info(void)
 
        /* Sort of per-model blacklist */
        if (strncmp(model->string.pointer, "L2B", 3) == 0)
-               hotk->methods->lcd_status = NULL; 
+               hotk->methods->lcd_status = NULL;
        /* L2B is similar enough to L3C to use its settings, with this only 
           exception */
        else if (strncmp(model->string.pointer, "S5N", 3) == 0 ||
                 strncmp(model->string.pointer, "M5N", 3) == 0)
-               hotk->methods->mt_mled = NULL; 
+               hotk->methods->mt_mled = NULL;
        /* S5N and M5N have no MLED */
        else if (strncmp(model->string.pointer, "M2N", 3) == 0 ||
                 strncmp(model->string.pointer, "W1N", 3) == 0)
-               hotk->methods->mt_wled = "WLED"; 
+               hotk->methods->mt_wled = "WLED";
        /* M2N and W1N have a usable WLED */
        else if (asus_info) {
                if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
                        hotk->methods->mled_status = NULL;
-       /* S1300A reports L84F, but L1400B too, account for that */
+               /* S1300A reports L84F, but L1400B too, account for that */
        }
 
        acpi_os_free(model);
@@ -1091,7 +1090,6 @@ static int __init asus_hotk_get_info(void)
        return AE_OK;
 }
 
-
 static int __init asus_hotk_check(void)
 {
        int result = 0;
@@ -1110,7 +1108,6 @@ static int __init asus_hotk_check(void)
        return result;
 }
 
-
 static int __init asus_hotk_add(struct acpi_device *device)
 {
        acpi_status status = AE_OK;
@@ -1123,7 +1120,7 @@ static int __init asus_hotk_add(struct acpi_device *device)
               ASUS_ACPI_VERSION);
 
        hotk =
-           (struct asus_hotk *) kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
+           (struct asus_hotk *)kmalloc(sizeof(struct asus_hotk), GFP_KERNEL);
        if (!hotk)
                return -ENOMEM;
        memset(hotk, 0, sizeof(struct asus_hotk));
@@ -1134,7 +1131,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
        acpi_driver_data(device) = hotk;
        hotk->device = device;
 
-
        result = asus_hotk_check();
        if (result)
                goto end;
@@ -1153,17 +1149,22 @@ static int __init asus_hotk_add(struct acpi_device *device)
                printk(KERN_ERR "  Error installing notify handler\n");
 
        /* For laptops without GPLV: init the hotk->brightness value */
-       if ((!hotk->methods->brightness_get) && (!hotk->methods->brightness_status) &&
-           (hotk->methods->brightness_up && hotk->methods->brightness_down)) {
-               status = acpi_evaluate_object(NULL, hotk->methods->brightness_down,
-                                             NULL, NULL);
+       if ((!hotk->methods->brightness_get)
+           && (!hotk->methods->brightness_status)
+           && (hotk->methods->brightness_up
+               && hotk->methods->brightness_down)) {
+               status =
+                   acpi_evaluate_object(NULL, hotk->methods->brightness_down,
+                                        NULL, NULL);
                if (ACPI_FAILURE(status))
                        printk(KERN_WARNING "  Error changing brightness\n");
                else {
-                       status = acpi_evaluate_object(NULL, hotk->methods->brightness_up,
-                                                     NULL, NULL);
+                       status =
+                           acpi_evaluate_object(NULL,
+                                                hotk->methods->brightness_up,
+                                                NULL, NULL);
                        if (ACPI_FAILURE(status))
-                               printk(KERN_WARNING "  Strange, error changing" 
+                               printk(KERN_WARNING "  Strange, error changing"
                                       " brightness\n");
                }
        }
@@ -1176,7 +1177,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
        return result;
 }
 
-
 static int asus_hotk_remove(struct acpi_device *device, int type)
 {
        acpi_status status = 0;
@@ -1196,7 +1196,6 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
        return 0;
 }
 
-
 static int __init asus_acpi_init(void)
 {
        int result;
@@ -1204,9 +1203,9 @@ static int __init asus_acpi_init(void)
        if (acpi_disabled)
                return -ENODEV;
 
-       if (!acpi_specific_hotkey_enabled){
+       if (!acpi_specific_hotkey_enabled) {
                printk(KERN_ERR "Using generic hotkey driver\n");
-               return -ENODEV; 
+               return -ENODEV;
        }
        asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
        if (!asus_proc_dir) {
@@ -1225,7 +1224,6 @@ static int __init asus_acpi_init(void)
        return 0;
 }
 
-
 static void __exit asus_acpi_exit(void)
 {
        acpi_bus_unregister_driver(&asus_hotk_driver);
index c55feca..702e857 100644 (file)
@@ -34,7 +34,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF
 
 #define ACPI_BATTERY_FORMAT_BIF        "NNNNNNNNNSSSS"
 #define ACPI_BATTERY_UNITS_WATTS       "mW"
 #define ACPI_BATTERY_UNITS_AMPS                "mA"
 
-
 #define _COMPONENT             ACPI_BATTERY_COMPONENT
-ACPI_MODULE_NAME               ("acpi_battery")
+ACPI_MODULE_NAME("acpi_battery")
 
-MODULE_AUTHOR("Paul Diefenbaugh");
+    MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_BATTERY_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-static int acpi_battery_add (struct acpi_device *device);
-static int acpi_battery_remove (struct acpi_device *device, int type);
+static int acpi_battery_add(struct acpi_device *device);
+static int acpi_battery_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_battery_driver = {
-       .name =         ACPI_BATTERY_DRIVER_NAME,
-       .class =        ACPI_BATTERY_CLASS,
-       .ids =          ACPI_BATTERY_HID,
-       .ops =          {
-                               .add =          acpi_battery_add,
-                               .remove =       acpi_battery_remove,
-                       },
+       .name = ACPI_BATTERY_DRIVER_NAME,
+       .class = ACPI_BATTERY_CLASS,
+       .ids = ACPI_BATTERY_HID,
+       .ops = {
+               .add = acpi_battery_add,
+               .remove = acpi_battery_remove,
+               },
 };
 
 struct acpi_battery_status {
-       acpi_integer            state;
-       acpi_integer            present_rate;
-       acpi_integer            remaining_capacity;
-       acpi_integer            present_voltage;
+       acpi_integer state;
+       acpi_integer present_rate;
+       acpi_integer remaining_capacity;
+       acpi_integer present_voltage;
 };
 
 struct acpi_battery_info {
-       acpi_integer            power_unit;
-       acpi_integer            design_capacity;
-       acpi_integer            last_full_capacity;
-       acpi_integer            battery_technology;
-       acpi_integer            design_voltage;
-       acpi_integer            design_capacity_warning;
-       acpi_integer            design_capacity_low;
-       acpi_integer            battery_capacity_granularity_1;
-       acpi_integer            battery_capacity_granularity_2;
-       acpi_string             model_number;
-       acpi_string             serial_number;
-       acpi_string             battery_type;
-       acpi_string             oem_info;
+       acpi_integer power_unit;
+       acpi_integer design_capacity;
+       acpi_integer last_full_capacity;
+       acpi_integer battery_technology;
+       acpi_integer design_voltage;
+       acpi_integer design_capacity_warning;
+       acpi_integer design_capacity_low;
+       acpi_integer battery_capacity_granularity_1;
+       acpi_integer battery_capacity_granularity_2;
+       acpi_string model_number;
+       acpi_string serial_number;
+       acpi_string battery_type;
+       acpi_string oem_info;
 };
 
 struct acpi_battery_flags {
-       u8                      present:1;      /* Bay occupied? */
-       u8                      power_unit:1;   /* 0=watts, 1=apms */
-       u8                      alarm:1;        /* _BTP present? */
-       u8                      reserved:5;
+       u8 present:1;           /* Bay occupied? */
+       u8 power_unit:1;        /* 0=watts, 1=apms */
+       u8 alarm:1;             /* _BTP present? */
+       u8 reserved:5;
 };
 
 struct acpi_battery_trips {
-       unsigned long           warning;
-       unsigned long           low;
+       unsigned long warning;
+       unsigned long low;
 };
 
 struct acpi_battery {
-       acpi_handle             handle;
+       acpi_handle handle;
        struct acpi_battery_flags flags;
        struct acpi_battery_trips trips;
-       unsigned long           alarm;
+       unsigned long alarm;
        struct acpi_battery_info *info;
 };
 
-
 /* --------------------------------------------------------------------------
                                Battery Management
    -------------------------------------------------------------------------- */
 
 static int
-acpi_battery_get_info (
-       struct acpi_battery     *battery,
-       struct acpi_battery_info **bif)
+acpi_battery_get_info(struct acpi_battery *battery,
+                     struct acpi_battery_info **bif)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_buffer      buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       struct acpi_buffer      format = {sizeof(ACPI_BATTERY_FORMAT_BIF),
-                                               ACPI_BATTERY_FORMAT_BIF};
-       struct acpi_buffer      data = {0, NULL};
-       union acpi_object       *package = NULL;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BIF),
+               ACPI_BATTERY_FORMAT_BIF
+       };
+       struct acpi_buffer data = { 0, NULL };
+       union acpi_object *package = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_get_info");
 
@@ -148,7 +145,7 @@ acpi_battery_get_info (
                return_VALUE(-ENODEV);
        }
 
-       package = (union acpi_object *) buffer.pointer;
+       package = (union acpi_object *)buffer.pointer;
 
        /* Extract Package Data */
 
@@ -174,27 +171,27 @@ acpi_battery_get_info (
                goto end;
        }
 
-end:
+      end:
        acpi_os_free(buffer.pointer);
 
        if (!result)
-               (*bif) = (struct acpi_battery_info *) data.pointer;
+               (*bif) = (struct acpi_battery_info *)data.pointer;
 
        return_VALUE(result);
 }
 
 static int
-acpi_battery_get_status (
-       struct acpi_battery     *battery,
-       struct acpi_battery_status **bst)
+acpi_battery_get_status(struct acpi_battery *battery,
+                       struct acpi_battery_status **bst)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_buffer      buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       struct acpi_buffer      format = {sizeof(ACPI_BATTERY_FORMAT_BST),
-                                               ACPI_BATTERY_FORMAT_BST};
-       struct acpi_buffer      data = {0, NULL};
-       union acpi_object       *package = NULL;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BST),
+               ACPI_BATTERY_FORMAT_BST
+       };
+       struct acpi_buffer data = { 0, NULL };
+       union acpi_object *package = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_get_status");
 
@@ -209,7 +206,7 @@ acpi_battery_get_status (
                return_VALUE(-ENODEV);
        }
 
-       package = (union acpi_object *) buffer.pointer;
+       package = (union acpi_object *)buffer.pointer;
 
        /* Extract Package Data */
 
@@ -235,24 +232,21 @@ acpi_battery_get_status (
                goto end;
        }
 
-end:
+      end:
        acpi_os_free(buffer.pointer);
 
        if (!result)
-               (*bst) = (struct acpi_battery_status *) data.pointer;
+               (*bst) = (struct acpi_battery_status *)data.pointer;
 
        return_VALUE(result);
 }
 
-
 static int
-acpi_battery_set_alarm (
-       struct acpi_battery     *battery,
-       unsigned long           alarm)
+acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm)
 {
-       acpi_status             status = 0;
-       union acpi_object       arg0 = {ACPI_TYPE_INTEGER};
-       struct acpi_object_list arg_list = {1, &arg0};
+       acpi_status status = 0;
+       union acpi_object arg0 = { ACPI_TYPE_INTEGER };
+       struct acpi_object_list arg_list = { 1, &arg0 };
 
        ACPI_FUNCTION_TRACE("acpi_battery_set_alarm");
 
@@ -275,19 +269,16 @@ acpi_battery_set_alarm (
        return_VALUE(0);
 }
 
-
-static int
-acpi_battery_check (
-       struct acpi_battery     *battery)
+static int acpi_battery_check(struct acpi_battery *battery)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       acpi_handle             handle = NULL;
-       struct acpi_device      *device = NULL;
+       int result = 0;
+       acpi_status status = AE_OK;
+       acpi_handle handle = NULL;
+       struct acpi_device *device = NULL;
        struct acpi_battery_info *bif = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_check");
-       
+
        if (!battery)
                return_VALUE(-EINVAL);
 
@@ -336,18 +327,17 @@ acpi_battery_check (
        return_VALUE(result);
 }
 
-
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-static struct proc_dir_entry   *acpi_battery_dir;
+static struct proc_dir_entry *acpi_battery_dir;
 static int acpi_battery_read_info(struct seq_file *seq, void *offset)
 {
-       int                     result = 0;
-       struct acpi_battery     *battery = (struct acpi_battery *) seq->private;
+       int result = 0;
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
        struct acpi_battery_info *bif = NULL;
-       char                    *units = "?";
+       char *units = "?";
 
        ACPI_FUNCTION_TRACE("acpi_battery_read_info");
 
@@ -369,19 +359,21 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
                goto end;
        }
 
-       units = bif->power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
-                                       
+       units =
+           bif->
+           power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+
        if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "design capacity:         unknown\n");
        else
                seq_printf(seq, "design capacity:         %d %sh\n",
-                       (u32) bif->design_capacity, units);
+                          (u32) bif->design_capacity, units);
 
        if (bif->last_full_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "last full capacity:      unknown\n");
        else
                seq_printf(seq, "last full capacity:      %d %sh\n",
-                       (u32) bif->last_full_capacity, units);
+                          (u32) bif->last_full_capacity, units);
 
        switch ((u32) bif->battery_technology) {
        case 0:
@@ -399,26 +391,22 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
                seq_printf(seq, "design voltage:          unknown\n");
        else
                seq_printf(seq, "design voltage:          %d mV\n",
-                       (u32) bif->design_voltage);
-       
+                          (u32) bif->design_voltage);
+
        seq_printf(seq, "design capacity warning: %d %sh\n",
-               (u32) bif->design_capacity_warning, units);
+                  (u32) bif->design_capacity_warning, units);
        seq_printf(seq, "design capacity low:     %d %sh\n",
-               (u32) bif->design_capacity_low, units);
+                  (u32) bif->design_capacity_low, units);
        seq_printf(seq, "capacity granularity 1:  %d %sh\n",
-               (u32) bif->battery_capacity_granularity_1, units);
+                  (u32) bif->battery_capacity_granularity_1, units);
        seq_printf(seq, "capacity granularity 2:  %d %sh\n",
-               (u32) bif->battery_capacity_granularity_2, units);
-       seq_printf(seq, "model number:            %s\n",
-               bif->model_number);
-       seq_printf(seq, "serial number:           %s\n",
-               bif->serial_number);
-       seq_printf(seq, "battery type:            %s\n",
-               bif->battery_type);
-       seq_printf(seq, "OEM info:                %s\n",
-               bif->oem_info);
-
-end:
+                  (u32) bif->battery_capacity_granularity_2, units);
+       seq_printf(seq, "model number:            %s\n", bif->model_number);
+       seq_printf(seq, "serial number:           %s\n", bif->serial_number);
+       seq_printf(seq, "battery type:            %s\n", bif->battery_type);
+       seq_printf(seq, "OEM info:                %s\n", bif->oem_info);
+
+      end:
        kfree(bif);
 
        return_VALUE(0);
@@ -429,14 +417,12 @@ static int acpi_battery_info_open_fs(struct inode *inode, struct file *file)
        return single_open(file, acpi_battery_read_info, PDE(inode)->data);
 }
 
-
-static int
-acpi_battery_read_state (struct seq_file *seq, void *offset)
+static int acpi_battery_read_state(struct seq_file *seq, void *offset)
 {
-       int                     result = 0;
-       struct acpi_battery     *battery = (struct acpi_battery *) seq->private;
+       int result = 0;
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
        struct acpi_battery_status *bst = NULL;
-       char                    *units = "?";
+       char *units = "?";
 
        ACPI_FUNCTION_TRACE("acpi_battery_read_state");
 
@@ -452,7 +438,9 @@ acpi_battery_read_state (struct seq_file *seq, void *offset)
 
        /* Battery Units */
 
-       units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+       units =
+           battery->flags.
+           power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
 
        /* Battery Status (_BST) */
 
@@ -467,12 +455,12 @@ acpi_battery_read_state (struct seq_file *seq, void *offset)
        else
                seq_printf(seq, "capacity state:          critical\n");
 
-       if ((bst->state & 0x01) && (bst->state & 0x02)){
-               seq_printf(seq, "charging state:          charging/discharging\n");
-               ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
-                                       "Battery Charging and Discharging?\n"));
-       }
-       else if (bst->state & 0x01)
+       if ((bst->state & 0x01) && (bst->state & 0x02)) {
+               seq_printf(seq,
+                          "charging state:          charging/discharging\n");
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                                 "Battery Charging and Discharging?\n"));
+       } else if (bst->state & 0x01)
                seq_printf(seq, "charging state:          discharging\n");
        else if (bst->state & 0x02)
                seq_printf(seq, "charging state:          charging\n");
@@ -484,21 +472,21 @@ acpi_battery_read_state (struct seq_file *seq, void *offset)
                seq_printf(seq, "present rate:            unknown\n");
        else
                seq_printf(seq, "present rate:            %d %s\n",
-                       (u32) bst->present_rate, units);
+                          (u32) bst->present_rate, units);
 
        if (bst->remaining_capacity == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "remaining capacity:      unknown\n");
        else
                seq_printf(seq, "remaining capacity:      %d %sh\n",
-                       (u32) bst->remaining_capacity, units);
+                          (u32) bst->remaining_capacity, units);
 
        if (bst->present_voltage == ACPI_BATTERY_VALUE_UNKNOWN)
                seq_printf(seq, "present voltage:         unknown\n");
        else
                seq_printf(seq, "present voltage:         %d mV\n",
-                       (u32) bst->present_voltage);
+                          (u32) bst->present_voltage);
 
-end:
+      end:
        kfree(bst);
 
        return_VALUE(0);
@@ -509,12 +497,10 @@ static int acpi_battery_state_open_fs(struct inode *inode, struct file *file)
        return single_open(file, acpi_battery_read_state, PDE(inode)->data);
 }
 
-
-static int
-acpi_battery_read_alarm (struct seq_file *seq, void *offset)
+static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
 {
-       struct acpi_battery     *battery = (struct acpi_battery *) seq->private;
-       char                    *units = "?";
+       struct acpi_battery *battery = (struct acpi_battery *)seq->private;
+       char *units = "?";
 
        ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
 
@@ -527,8 +513,10 @@ acpi_battery_read_alarm (struct seq_file *seq, void *offset)
        }
 
        /* Battery Units */
-       
-       units = battery->flags.power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
+
+       units =
+           battery->flags.
+           power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS;
 
        /* Battery Alarm */
 
@@ -538,22 +526,19 @@ acpi_battery_read_alarm (struct seq_file *seq, void *offset)
        else
                seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units);
 
-end:
+      end:
        return_VALUE(0);
 }
 
-
 static ssize_t
-acpi_battery_write_alarm (
-       struct file     *file,
-       const char      __user *buffer,
-       size_t          count,
-       loff_t          *ppos)
+acpi_battery_write_alarm(struct file *file,
+                        const char __user * buffer,
+                        size_t count, loff_t * ppos)
 {
-       int                     result = 0;
-       char                    alarm_string[12] = {'\0'};
-       struct seq_file         *m = (struct seq_file *)file->private_data;
-       struct acpi_battery     *battery = (struct acpi_battery *)m->private;
+       int result = 0;
+       char alarm_string[12] = { '\0' };
+       struct seq_file *m = (struct seq_file *)file->private_data;
+       struct acpi_battery *battery = (struct acpi_battery *)m->private;
 
        ACPI_FUNCTION_TRACE("acpi_battery_write_alarm");
 
@@ -565,11 +550,11 @@ acpi_battery_write_alarm (
 
        if (copy_from_user(alarm_string, buffer, count))
                return_VALUE(-EFAULT);
-       
+
        alarm_string[count] = '\0';
 
-       result = acpi_battery_set_alarm(battery, 
-               simple_strtoul(alarm_string, NULL, 0));
+       result = acpi_battery_set_alarm(battery,
+                                       simple_strtoul(alarm_string, NULL, 0));
        if (result)
                return_VALUE(result);
 
@@ -582,41 +567,39 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file)
 }
 
 static struct file_operations acpi_battery_info_ops = {
-       .open           = acpi_battery_info_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_battery_info_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
        .owner = THIS_MODULE,
 };
 
 static struct file_operations acpi_battery_state_ops = {
-       .open           = acpi_battery_state_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_battery_state_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
        .owner = THIS_MODULE,
 };
 
 static struct file_operations acpi_battery_alarm_ops = {
-       .open           = acpi_battery_alarm_open_fs,
-       .read           = seq_read,
-       .write          = acpi_battery_write_alarm,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_battery_alarm_open_fs,
+       .read = seq_read,
+       .write = acpi_battery_write_alarm,
+       .llseek = seq_lseek,
+       .release = single_release,
        .owner = THIS_MODULE,
 };
 
-static int
-acpi_battery_add_fs (
-       struct acpi_device      *device)
+static int acpi_battery_add_fs(struct acpi_device *device)
 {
-       struct proc_dir_entry   *entry = NULL;
+       struct proc_dir_entry *entry = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_add_fs");
 
        if (!acpi_device_dir(device)) {
                acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
-                       acpi_battery_dir);
+                                                    acpi_battery_dir);
                if (!acpi_device_dir(device))
                        return_VALUE(-ENODEV);
                acpi_device_dir(device)->owner = THIS_MODULE;
@@ -624,24 +607,24 @@ acpi_battery_add_fs (
 
        /* 'info' [R] */
        entry = create_proc_entry(ACPI_BATTERY_FILE_INFO,
-               S_IRUGO, acpi_device_dir(device));
+                                 S_IRUGO, acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_BATTERY_FILE_INFO));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_BATTERY_FILE_INFO));
        else {
-               entry->proc_fops = &acpi_battery_info_ops; 
+               entry->proc_fops = &acpi_battery_info_ops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
        }
 
        /* 'status' [R] */
        entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS,
-               S_IRUGO, acpi_device_dir(device));
+                                 S_IRUGO, acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_BATTERY_FILE_STATUS));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_BATTERY_FILE_STATUS));
        else {
                entry->proc_fops = &acpi_battery_state_ops;
                entry->data = acpi_driver_data(device);
@@ -650,11 +633,12 @@ acpi_battery_add_fs (
 
        /* 'alarm' [R/W] */
        entry = create_proc_entry(ACPI_BATTERY_FILE_ALARM,
-               S_IFREG|S_IRUGO|S_IWUSR, acpi_device_dir(device));
+                                 S_IFREG | S_IRUGO | S_IWUSR,
+                                 acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_BATTERY_FILE_ALARM));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_BATTERY_FILE_ALARM));
        else {
                entry->proc_fops = &acpi_battery_alarm_ops;
                entry->data = acpi_driver_data(device);
@@ -664,10 +648,7 @@ acpi_battery_add_fs (
        return_VALUE(0);
 }
 
-
-static int
-acpi_battery_remove_fs (
-       struct acpi_device      *device)
+static int acpi_battery_remove_fs(struct acpi_device *device)
 {
        ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
 
@@ -686,19 +667,14 @@ acpi_battery_remove_fs (
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                                  Driver Interface
    -------------------------------------------------------------------------- */
 
-static void
-acpi_battery_notify (
-       acpi_handle             handle,
-       u32                     event,
-       void                    *data)
+static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_battery     *battery = (struct acpi_battery *) data;
-       struct acpi_device      *device = NULL;
+       struct acpi_battery *battery = (struct acpi_battery *)data;
+       struct acpi_device *device = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_notify");
 
@@ -716,24 +692,21 @@ acpi_battery_notify (
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-
-static int
-acpi_battery_add (
-       struct acpi_device      *device)
+static int acpi_battery_add(struct acpi_device *device)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_battery     *battery = NULL;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_battery *battery = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_add");
-       
+
        if (!device)
                return_VALUE(-EINVAL);
 
@@ -756,19 +729,20 @@ acpi_battery_add (
                goto end;
 
        status = acpi_install_notify_handler(battery->handle,
-               ACPI_DEVICE_NOTIFY, acpi_battery_notify, battery);
+                                            ACPI_DEVICE_NOTIFY,
+                                            acpi_battery_notify, battery);
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
 
        printk(KERN_INFO PREFIX "%s Slot [%s] (battery %s)\n",
-               ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
-               device->status.battery_present?"present":"absent");
-               
-end:
+              ACPI_BATTERY_DEVICE_NAME, acpi_device_bid(device),
+              device->status.battery_present ? "present" : "absent");
+
+      end:
        if (result) {
                acpi_battery_remove_fs(device);
                kfree(battery);
@@ -777,27 +751,24 @@ end:
        return_VALUE(result);
 }
 
-
-static int
-acpi_battery_remove (
-       struct acpi_device      *device,
-       int                     type)
+static int acpi_battery_remove(struct acpi_device *device, int type)
 {
-       acpi_status             status = 0;
-       struct acpi_battery     *battery = NULL;
+       acpi_status status = 0;
+       struct acpi_battery *battery = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_battery_remove");
 
        if (!device || !acpi_driver_data(device))
                return_VALUE(-EINVAL);
 
-       battery = (struct acpi_battery *) acpi_driver_data(device);
+       battery = (struct acpi_battery *)acpi_driver_data(device);
 
        status = acpi_remove_notify_handler(battery->handle,
-               ACPI_DEVICE_NOTIFY, acpi_battery_notify);
+                                           ACPI_DEVICE_NOTIFY,
+                                           acpi_battery_notify);
        if (ACPI_FAILURE(status))
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
 
        acpi_battery_remove_fs(device);
 
@@ -806,11 +777,9 @@ acpi_battery_remove (
        return_VALUE(0);
 }
 
-
-static int __init
-acpi_battery_init (void)
+static int __init acpi_battery_init(void)
 {
-       int                     result = 0;
+       int result = 0;
 
        ACPI_FUNCTION_TRACE("acpi_battery_init");
 
@@ -828,9 +797,7 @@ acpi_battery_init (void)
        return_VALUE(0);
 }
 
-
-static void __exit
-acpi_battery_exit (void)
+static void __exit acpi_battery_exit(void)
 {
        ACPI_FUNCTION_TRACE("acpi_battery_exit");
 
@@ -841,6 +808,5 @@ acpi_battery_exit (void)
        return_VOID;
 }
 
-
 module_init(acpi_battery_init);
 module_exit(acpi_battery_exit);
index 4c010e7..9824f67 100644 (file)
@@ -26,7 +26,6 @@
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <acpi/acpi_bus.h>
 #include <linux/dmi.h>
 
-enum acpi_blacklist_predicates
-{
-        all_versions,
-        less_than_or_equal,
-        equal,
-        greater_than_or_equal,
+enum acpi_blacklist_predicates {
+       all_versions,
+       less_than_or_equal,
+       equal,
+       greater_than_or_equal,
 };
 
-struct acpi_blacklist_item
-{
-        char            oem_id[7];
-        char            oem_table_id[9];
-        u32             oem_revision;
-        acpi_table_type table;
-        enum acpi_blacklist_predicates oem_revision_predicate;
-        char            *reason;
-        u32             is_critical_error;
+struct acpi_blacklist_item {
+       char oem_id[7];
+       char oem_table_id[9];
+       u32 oem_revision;
+       acpi_table_type table;
+       enum acpi_blacklist_predicates oem_revision_predicate;
+       char *reason;
+       u32 is_critical_error;
 };
 
 /*
  * POLICY: If *anything* doesn't work, put it on the blacklist.
  *        If they are critical errors, mark it critical, and abort driver load.
  */
-static struct acpi_blacklist_item acpi_blacklist[] __initdata =
-{
+static struct acpi_blacklist_item acpi_blacklist[] __initdata = {
        /* Compaq Presario 1700 */
-       {"PTLTD ", "  DSDT  ", 0x06040000, ACPI_DSDT, less_than_or_equal, "Multiple problems", 1},
+       {"PTLTD ", "  DSDT  ", 0x06040000, ACPI_DSDT, less_than_or_equal,
+        "Multiple problems", 1},
        /* Sony FX120, FX140, FX150? */
-       {"SONY  ", "U0      ", 0x20010313, ACPI_DSDT, less_than_or_equal, "ACPI driver problem", 1},
+       {"SONY  ", "U0      ", 0x20010313, ACPI_DSDT, less_than_or_equal,
+        "ACPI driver problem", 1},
        /* Compaq Presario 800, Insyde BIOS */
-       {"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1},
+       {"INT440", "SYSFexxx", 0x00001001, ACPI_DSDT, less_than_or_equal,
+        "Does not use _REG to protect EC OpRegions", 1},
        /* IBM 600E - _ADR should return 7, but it returns 1 */
-       {"IBM   ", "TP600E  ", 0x00000105, ACPI_DSDT, less_than_or_equal, "Incorrect _ADR", 1},
-       {"ASUS\0\0", "P2B-S   ", 0, ACPI_DSDT, all_versions, "Bogus PCI routing", 1},
+       {"IBM   ", "TP600E  ", 0x00000105, ACPI_DSDT, less_than_or_equal,
+        "Incorrect _ADR", 1},
+       {"ASUS\0\0", "P2B-S   ", 0, ACPI_DSDT, all_versions,
+        "Bogus PCI routing", 1},
 
        {""}
 };
 
-
 #if    CONFIG_ACPI_BLACKLIST_YEAR
 
-static int __init
-blacklist_by_year(void)
+static int __init blacklist_by_year(void)
 {
        int year;
        char *s = dmi_get_system_info(DMI_BIOS_DATE);
@@ -92,36 +91,38 @@ blacklist_by_year(void)
 
        s += 1;
 
-       year = simple_strtoul(s,NULL,0); 
+       year = simple_strtoul(s, NULL, 0);
 
-       if (year < 100) {               /* 2-digit year */
+       if (year < 100) {       /* 2-digit year */
                year += 1900;
                if (year < 1996)        /* no dates < spec 1.0 */
                        year += 100;
        }
 
        if (year < CONFIG_ACPI_BLACKLIST_YEAR) {
-               printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), " 
-                       "acpi=force is required to enable ACPI\n",
-                       year, CONFIG_ACPI_BLACKLIST_YEAR);
+               printk(KERN_ERR PREFIX "BIOS age (%d) fails cutoff (%d), "
+                      "acpi=force is required to enable ACPI\n",
+                      year, CONFIG_ACPI_BLACKLIST_YEAR);
                return 1;
        }
        return 0;
 }
 #else
-static inline int blacklist_by_year(void) { return 0; }
+static inline int blacklist_by_year(void)
+{
+       return 0;
+}
 #endif
 
-int __init
-acpi_blacklisted(void)
+int __init acpi_blacklisted(void)
 {
        int i = 0;
        int blacklisted = 0;
        struct acpi_table_header *table_header;
 
-       while (acpi_blacklist[i].oem_id[0] != '\0')
-       {
-               if (acpi_get_table_header_early(acpi_blacklist[i].table, &table_header)) {
+       while (acpi_blacklist[i].oem_id[0] != '\0') {
+               if (acpi_get_table_header_early
+                   (acpi_blacklist[i].table, &table_header)) {
                        i++;
                        continue;
                }
@@ -131,33 +132,43 @@ acpi_blacklisted(void)
                        continue;
                }
 
-               if (strncmp(acpi_blacklist[i].oem_table_id, table_header->oem_table_id, 8)) {
+               if (strncmp
+                   (acpi_blacklist[i].oem_table_id, table_header->oem_table_id,
+                    8)) {
                        i++;
                        continue;
                }
 
                if ((acpi_blacklist[i].oem_revision_predicate == all_versions)
-                   || (acpi_blacklist[i].oem_revision_predicate == less_than_or_equal
-                       && table_header->oem_revision <= acpi_blacklist[i].oem_revision)
-                   || (acpi_blacklist[i].oem_revision_predicate == greater_than_or_equal
-                       && table_header->oem_revision >= acpi_blacklist[i].oem_revision)
+                   || (acpi_blacklist[i].oem_revision_predicate ==
+                       less_than_or_equal
+                       && table_header->oem_revision <=
+                       acpi_blacklist[i].oem_revision)
+                   || (acpi_blacklist[i].oem_revision_predicate ==
+                       greater_than_or_equal
+                       && table_header->oem_revision >=
+                       acpi_blacklist[i].oem_revision)
                    || (acpi_blacklist[i].oem_revision_predicate == equal
-                       && table_header->oem_revision == acpi_blacklist[i].oem_revision)) {
-
-                       printk(KERN_ERR PREFIX "Vendor \"%6.6s\" System \"%8.8s\" "
-                               "Revision 0x%x has a known ACPI BIOS problem.\n",
-                               acpi_blacklist[i].oem_id,
-                               acpi_blacklist[i].oem_table_id,
-                               acpi_blacklist[i].oem_revision);
-
-                       printk(KERN_ERR PREFIX "Reason: %s. This is a %s error\n",
-                               acpi_blacklist[i].reason,
-                               (acpi_blacklist[i].is_critical_error ? "non-recoverable" : "recoverable"));
+                       && table_header->oem_revision ==
+                       acpi_blacklist[i].oem_revision)) {
+
+                       printk(KERN_ERR PREFIX
+                              "Vendor \"%6.6s\" System \"%8.8s\" "
+                              "Revision 0x%x has a known ACPI BIOS problem.\n",
+                              acpi_blacklist[i].oem_id,
+                              acpi_blacklist[i].oem_table_id,
+                              acpi_blacklist[i].oem_revision);
+
+                       printk(KERN_ERR PREFIX
+                              "Reason: %s. This is a %s error\n",
+                              acpi_blacklist[i].reason,
+                              (acpi_blacklist[i].
+                               is_critical_error ? "non-recoverable" :
+                               "recoverable"));
 
                        blacklisted = acpi_blacklist[i].is_critical_error;
                        break;
-               }
-               else {
+               } else {
                        i++;
                }
        }
@@ -166,4 +177,3 @@ acpi_blacklisted(void)
 
        return blacklisted;
 }
-
index d77c230..6a4da41 100644 (file)
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define _COMPONENT             ACPI_BUS_COMPONENT
-ACPI_MODULE_NAME               ("acpi_bus")
-
+ACPI_MODULE_NAME("acpi_bus")
 #ifdef CONFIG_X86
 extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger);
 #endif
 
-FADT_DESCRIPTOR                        acpi_fadt;
+FADT_DESCRIPTOR acpi_fadt;
 EXPORT_SYMBOL(acpi_fadt);
 
-struct acpi_device             *acpi_root;
-struct proc_dir_entry          *acpi_root_dir;
+struct acpi_device *acpi_root;
+struct proc_dir_entry *acpi_root_dir;
 EXPORT_SYMBOL(acpi_root_dir);
 
 #define STRUCT_TO_INT(s)       (*((int*)&s))
@@ -57,12 +55,9 @@ EXPORT_SYMBOL(acpi_root_dir);
                                 Device Management
    -------------------------------------------------------------------------- */
 
-int
-acpi_bus_get_device (
-       acpi_handle             handle,
-       struct acpi_device      **device)
+int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
 {
-       acpi_status             status = AE_OK;
+       acpi_status status = AE_OK;
 
        ACPI_FUNCTION_TRACE("acpi_bus_get_device");
 
@@ -71,24 +66,23 @@ acpi_bus_get_device (
 
        /* TBD: Support fixed-feature devices */
 
-       status = acpi_get_data(handle, acpi_bus_data_handler, (void**) device);
+       status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
        if (ACPI_FAILURE(status) || !*device) {
                ACPI_DEBUG_PRINT((ACPI_DB_WARN, "No context for object [%p]\n",
-                       handle));
+                                 handle));
                return_VALUE(-ENODEV);
        }
 
        return_VALUE(0);
 }
+
 EXPORT_SYMBOL(acpi_bus_get_device);
 
-int
-acpi_bus_get_status (
-       struct acpi_device      *device)
+int acpi_bus_get_status(struct acpi_device *device)
 {
-       acpi_status             status = AE_OK;
-       unsigned long           sta = 0;
-       
+       acpi_status status = AE_OK;
+       unsigned long sta = 0;
+
        ACPI_FUNCTION_TRACE("acpi_bus_get_status");
 
        if (!device)
@@ -98,10 +92,11 @@ acpi_bus_get_status (
         * Evaluate _STA if present.
         */
        if (device->flags.dynamic_status) {
-               status = acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
+               status =
+                   acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
                if (ACPI_FAILURE(status))
                        return_VALUE(-ENODEV);
-               STRUCT_TO_INT(device->status) = (int) sta;
+               STRUCT_TO_INT(device->status) = (int)sta;
        }
 
        /*
@@ -115,33 +110,30 @@ acpi_bus_get_status (
 
        if (device->status.functional && !device->status.present) {
                printk(KERN_WARNING PREFIX "Device [%s] status [%08x]: "
-                       "functional but not present; setting present\n",
-                       device->pnp.bus_id,
-                       (u32) STRUCT_TO_INT(device->status));
+                      "functional but not present; setting present\n",
+                      device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status));
                device->status.present = 1;
        }
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n", 
-               device->pnp.bus_id, (u32) STRUCT_TO_INT(device->status)));
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] status [%08x]\n",
+                         device->pnp.bus_id,
+                         (u32) STRUCT_TO_INT(device->status)));
 
        return_VALUE(0);
 }
-EXPORT_SYMBOL(acpi_bus_get_status);
 
+EXPORT_SYMBOL(acpi_bus_get_status);
 
 /* --------------------------------------------------------------------------
                                  Power Management
    -------------------------------------------------------------------------- */
 
-int
-acpi_bus_get_power (
-       acpi_handle             handle,
-       int                     *state)
+int acpi_bus_get_power(acpi_handle handle, int *state)
 {
-       int                     result = 0;
-       acpi_status             status = 0;
-       struct acpi_device      *device = NULL;
-       unsigned long           psc = 0;
+       int result = 0;
+       acpi_status status = 0;
+       struct acpi_device *device = NULL;
+       unsigned long psc = 0;
 
        ACPI_FUNCTION_TRACE("acpi_bus_get_power");
 
@@ -157,20 +149,18 @@ acpi_bus_get_power (
                        *state = device->parent->power.state;
                else
                        *state = ACPI_STATE_D0;
-       }
-       else {
+       } else {
                /*
                 * Get the device's power state either directly (via _PSC) or 
                 * indirectly (via power resources).
                 */
                if (device->power.flags.explicit_get) {
-                       status = acpi_evaluate_integer(device->handle, "_PSC", 
-                               NULL, &psc);
+                       status = acpi_evaluate_integer(device->handle, "_PSC",
+                                                      NULL, &psc);
                        if (ACPI_FAILURE(status))
                                return_VALUE(-ENODEV);
-                       device->power.state = (int) psc;
-               }
-               else if (device->power.flags.power_resources) {
+                       device->power.state = (int)psc;
+               } else if (device->power.flags.power_resources) {
                        result = acpi_power_get_inferred_state(device);
                        if (result)
                                return_VALUE(result);
@@ -180,22 +170,19 @@ acpi_bus_get_power (
        }
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] power state is D%d\n",
-               device->pnp.bus_id, device->power.state));
+                         device->pnp.bus_id, device->power.state));
 
        return_VALUE(0);
 }
-EXPORT_SYMBOL(acpi_bus_get_power);
 
+EXPORT_SYMBOL(acpi_bus_get_power);
 
-int
-acpi_bus_set_power (
-       acpi_handle             handle,
-       int                     state)
+int acpi_bus_set_power(acpi_handle handle, int state)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       struct acpi_device      *device = NULL;
-       char                    object_name[5] = {'_','P','S','0'+state,'\0'};
+       int result = 0;
+       acpi_status status = AE_OK;
+       struct acpi_device *device = NULL;
+       char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
 
        ACPI_FUNCTION_TRACE("acpi_bus_set_power");
 
@@ -209,7 +196,8 @@ acpi_bus_set_power (
        /* Make sure this is a valid target state */
 
        if (!device->flags.power_manageable) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device is not power manageable\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+                                 "Device is not power manageable\n"));
                return_VALUE(-ENODEV);
        }
        /*
@@ -219,15 +207,18 @@ acpi_bus_set_power (
        if (device->power.state == ACPI_STATE_UNKNOWN)
                acpi_bus_get_power(device->handle, &device->power.state);
        if (state == device->power.state) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
+                                 state));
                return_VALUE(0);
        }
        if (!device->power.states[state].flags.valid) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n", state));
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device does not support D%d\n",
+                                 state));
                return_VALUE(-ENODEV);
        }
        if (device->parent && (state < device->parent->power.state)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Cannot set device to a higher-powered state than parent\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+                                 "Cannot set device to a higher-powered state than parent\n"));
                return_VALUE(-ENODEV);
        }
 
@@ -245,18 +236,17 @@ acpi_bus_set_power (
                                goto end;
                }
                if (device->power.states[state].flags.explicit_set) {
-                       status = acpi_evaluate_object(device->handle, 
-                               object_name, NULL, NULL);
+                       status = acpi_evaluate_object(device->handle,
+                                                     object_name, NULL, NULL);
                        if (ACPI_FAILURE(status)) {
                                result = -ENODEV;
                                goto end;
                        }
                }
-       }
-       else {
+       } else {
                if (device->power.states[state].flags.explicit_set) {
-                       status = acpi_evaluate_object(device->handle, 
-                               object_name, NULL, NULL);
+                       status = acpi_evaluate_object(device->handle,
+                                                     object_name, NULL, NULL);
                        if (ACPI_FAILURE(status)) {
                                result = -ENODEV;
                                goto end;
@@ -269,19 +259,20 @@ acpi_bus_set_power (
                }
        }
 
-end:
+      end:
        if (result)
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error transitioning device [%s] to D%d\n",
-                       device->pnp.bus_id, state));
+               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
+                                 "Error transitioning device [%s] to D%d\n",
+                                 device->pnp.bus_id, state));
        else
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device [%s] transitioned to D%d\n",
-                       device->pnp.bus_id, state));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Device [%s] transitioned to D%d\n",
+                                 device->pnp.bus_id, state));
 
        return_VALUE(result);
 }
-EXPORT_SYMBOL(acpi_bus_set_power);
-
 
+EXPORT_SYMBOL(acpi_bus_set_power);
 
 /* --------------------------------------------------------------------------
                                 Event Management
@@ -292,16 +283,12 @@ static DEFINE_SPINLOCK(acpi_bus_event_lock);
 LIST_HEAD(acpi_bus_event_list);
 DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
 
-extern int                     event_is_open;
+extern int event_is_open;
 
-int
-acpi_bus_generate_event (
-       struct acpi_device      *device,
-       u8                      type,
-       int                     data)
+int acpi_bus_generate_event(struct acpi_device *device, u8 type, int data)
 {
-       struct acpi_bus_event   *event = NULL;
-       unsigned long           flags = 0;
+       struct acpi_bus_event *event = NULL;
+       unsigned long flags = 0;
 
        ACPI_FUNCTION_TRACE("acpi_bus_generate_event");
 
@@ -329,14 +316,13 @@ acpi_bus_generate_event (
 
        return_VALUE(0);
 }
+
 EXPORT_SYMBOL(acpi_bus_generate_event);
 
-int
-acpi_bus_receive_event (
-       struct acpi_bus_event   *event)
+int acpi_bus_receive_event(struct acpi_bus_event *event)
 {
-       unsigned long           flags = 0;
-       struct acpi_bus_event   *entry = NULL;
+       unsigned long flags = 0;
+       struct acpi_bus_event *entry = NULL;
 
        DECLARE_WAITQUEUE(wait, current);
 
@@ -361,7 +347,8 @@ acpi_bus_receive_event (
        }
 
        spin_lock_irqsave(&acpi_bus_event_lock, flags);
-       entry = list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node);
+       entry =
+           list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node);
        if (entry)
                list_del(&entry->node);
        spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
@@ -375,19 +362,17 @@ acpi_bus_receive_event (
 
        return_VALUE(0);
 }
-EXPORT_SYMBOL(acpi_bus_receive_event);
 
+EXPORT_SYMBOL(acpi_bus_receive_event);
 
 /* --------------------------------------------------------------------------
                              Notification Handling
    -------------------------------------------------------------------------- */
 
 static int
-acpi_bus_check_device (
-       struct acpi_device      *device,
-       int                     *status_changed)
+acpi_bus_check_device(struct acpi_device *device, int *status_changed)
 {
-       acpi_status             status = 0;
+       acpi_status status = 0;
        struct acpi_device_status old_status;
 
        ACPI_FUNCTION_TRACE("acpi_bus_check_device");
@@ -422,15 +407,14 @@ acpi_bus_check_device (
 
        if (status_changed)
                *status_changed = 1;
-       
+
        /*
         * Device Insertion/Removal
         */
        if ((device->status.present) && !(old_status.present)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device insertion detected\n"));
                /* TBD: Handle device insertion */
-       }
-       else if (!(device->status.present) && (old_status.present)) {
+       } else if (!(device->status.present) && (old_status.present)) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n"));
                /* TBD: Handle device removal */
        }
@@ -438,13 +422,10 @@ acpi_bus_check_device (
        return_VALUE(0);
 }
 
-
-static int
-acpi_bus_check_scope (
-       struct acpi_device      *device)
+static int acpi_bus_check_scope(struct acpi_device *device)
 {
-       int                     result = 0;
-       int                     status_changed = 0;
+       int result = 0;
+       int status_changed = 0;
 
        ACPI_FUNCTION_TRACE("acpi_bus_check_scope");
 
@@ -467,20 +448,15 @@ acpi_bus_check_scope (
        return_VALUE(0);
 }
 
-
 /**
  * acpi_bus_notify
  * ---------------
  * Callback for all 'system-level' device notifications (values 0x00-0x7F).
  */
-static void 
-acpi_bus_notify (
-       acpi_handle             handle,
-       u32                     type,
-       void                    *data)
+static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
 {
-       int                     result = 0;
-       struct acpi_device      *device = NULL;
+       int result = 0;
+       struct acpi_device *device = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_bus_notify");
 
@@ -490,64 +466,73 @@ acpi_bus_notify (
        switch (type) {
 
        case ACPI_NOTIFY_BUS_CHECK:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS CHECK notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received BUS CHECK notification for device [%s]\n",
+                                 device->pnp.bus_id));
                result = acpi_bus_check_scope(device);
                /* 
                 * TBD: We'll need to outsource certain events to non-ACPI
-                *      drivers via the device manager (device.c).
+                *      drivers via the device manager (device.c).
                 */
                break;
 
        case ACPI_NOTIFY_DEVICE_CHECK:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received DEVICE CHECK notification for device [%s]\n",
+                                 device->pnp.bus_id));
                result = acpi_bus_check_device(device, NULL);
                /* 
                 * TBD: We'll need to outsource certain events to non-ACPI
-                *      drivers via the device manager (device.c).
+                *      drivers via the device manager (device.c).
                 */
                break;
 
        case ACPI_NOTIFY_DEVICE_WAKE:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE WAKE notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received DEVICE WAKE notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD */
                break;
 
        case ACPI_NOTIFY_EJECT_REQUEST:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received EJECT REQUEST notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received EJECT REQUEST notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD */
                break;
 
        case ACPI_NOTIFY_DEVICE_CHECK_LIGHT:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received DEVICE CHECK LIGHT notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received DEVICE CHECK LIGHT notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD: Exactly what does 'light' mean? */
                break;
 
        case ACPI_NOTIFY_FREQUENCY_MISMATCH:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received FREQUENCY MISMATCH notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received FREQUENCY MISMATCH notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD */
                break;
 
        case ACPI_NOTIFY_BUS_MODE_MISMATCH:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received BUS MODE MISMATCH notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received BUS MODE MISMATCH notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD */
                break;
 
        case ACPI_NOTIFY_POWER_FAULT:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received POWER FAULT notification for device [%s]\n", 
-                       device->pnp.bus_id));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received POWER FAULT notification for device [%s]\n",
+                                 device->pnp.bus_id));
                /* TBD */
                break;
 
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Received unknown/unsupported notification [%08x]\n", 
-                       type));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Received unknown/unsupported notification [%08x]\n",
+                                 type));
                break;
        }
 
@@ -558,13 +543,12 @@ acpi_bus_notify (
                              Initialization/Cleanup
    -------------------------------------------------------------------------- */
 
-static int __init
-acpi_bus_init_irq (void)
+static int __init acpi_bus_init_irq(void)
 {
-       acpi_status             status = AE_OK;
-       union acpi_object       arg = {ACPI_TYPE_INTEGER};
-       struct acpi_object_list arg_list = {1, &arg};
-       char                    *message = NULL;
+       acpi_status status = AE_OK;
+       union acpi_object arg = { ACPI_TYPE_INTEGER };
+       struct acpi_object_list arg_list = { 1, &arg };
+       char *message = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_bus_init_irq");
 
@@ -601,12 +585,10 @@ acpi_bus_init_irq (void)
        return_VALUE(0);
 }
 
-
-void __init
-acpi_early_init (void)
+void __init acpi_early_init(void)
 {
-       acpi_status             status = AE_OK;
-       struct acpi_buffer      buffer = {sizeof(acpi_fadt), &acpi_fadt};
+       acpi_status status = AE_OK;
+       struct acpi_buffer buffer = { sizeof(acpi_fadt), &acpi_fadt };
 
        ACPI_FUNCTION_TRACE("acpi_early_init");
 
@@ -619,13 +601,15 @@ acpi_early_init (void)
 
        status = acpi_initialize_subsystem();
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to initialize the ACPI Interpreter\n");
+               printk(KERN_ERR PREFIX
+                      "Unable to initialize the ACPI Interpreter\n");
                goto error0;
        }
 
        status = acpi_load_tables();
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to load the System Description Tables\n");
+               printk(KERN_ERR PREFIX
+                      "Unable to load the System Description Tables\n");
                goto error0;
        }
 
@@ -637,7 +621,6 @@ acpi_early_init (void)
                printk(KERN_ERR PREFIX "Unable to get the FADT\n");
                goto error0;
        }
-
 #ifdef CONFIG_X86
        if (!acpi_ioapic) {
                extern acpi_interrupt_flags acpi_sci_flags;
@@ -647,7 +630,8 @@ acpi_early_init (void)
                        acpi_sci_flags.trigger = 3;
 
                /* Set PIC-mode SCI trigger type */
-               acpi_pic_sci_set_trigger(acpi_fadt.sci_int, acpi_sci_flags.trigger);
+               acpi_pic_sci_set_trigger(acpi_fadt.sci_int,
+                                        acpi_sci_flags.trigger);
        } else {
                extern int acpi_sci_override_gsi;
                /*
@@ -658,7 +642,10 @@ acpi_early_init (void)
        }
 #endif
 
-       status = acpi_enable_subsystem(~(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE));
+       status =
+           acpi_enable_subsystem(~
+                                 (ACPI_NO_HARDWARE_INIT |
+                                  ACPI_NO_ACPI_ENABLE));
        if (ACPI_FAILURE(status)) {
                printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
                goto error0;
@@ -666,30 +653,32 @@ acpi_early_init (void)
 
        return_VOID;
 
-error0:
+      error0:
        disable_acpi();
        return_VOID;
 }
 
-static int __init
-acpi_bus_init (void)
+static int __init acpi_bus_init(void)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       extern acpi_status      acpi_os_initialize1(void);
+       int result = 0;
+       acpi_status status = AE_OK;
+       extern acpi_status acpi_os_initialize1(void);
 
        ACPI_FUNCTION_TRACE("acpi_bus_init");
 
        status = acpi_os_initialize1();
 
-       status = acpi_enable_subsystem(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE);
+       status =
+           acpi_enable_subsystem(ACPI_NO_HARDWARE_INIT | ACPI_NO_ACPI_ENABLE);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to start the ACPI Interpreter\n");
+               printk(KERN_ERR PREFIX
+                      "Unable to start the ACPI Interpreter\n");
                goto error1;
        }
 
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to initialize ACPI OS objects\n");
+               printk(KERN_ERR PREFIX
+                      "Unable to initialize ACPI OS objects\n");
                goto error1;
        }
 #ifdef CONFIG_ACPI_EC
@@ -723,9 +712,12 @@ acpi_bus_init (void)
        /*
         * Register the for all standard device notifications.
         */
-       status = acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY, &acpi_bus_notify, NULL);
+       status =
+           acpi_install_notify_handler(ACPI_ROOT_OBJECT, ACPI_SYSTEM_NOTIFY,
+                                       &acpi_bus_notify, NULL);
        if (ACPI_FAILURE(status)) {
-               printk(KERN_ERR PREFIX "Unable to register for device notifications\n");
+               printk(KERN_ERR PREFIX
+                      "Unable to register for device notifications\n");
                goto error1;
        }
 
@@ -737,21 +729,20 @@ acpi_bus_init (void)
        return_VALUE(0);
 
        /* Mimic structured exception handling */
-error1:
+      error1:
        acpi_terminate();
        return_VALUE(-ENODEV);
 }
 
-decl_subsys(acpi,NULL,NULL);
+decl_subsys(acpi, NULL, NULL);
 
-static int __init acpi_init (void)
+static int __init acpi_init(void)
 {
-       int                     result = 0;
+       int result = 0;
 
        ACPI_FUNCTION_TRACE("acpi_init");
 
-       printk(KERN_INFO PREFIX "Subsystem revision %08x\n",
-               ACPI_CA_VERSION);
+       printk(KERN_INFO PREFIX "Subsystem revision %08x\n", ACPI_CA_VERSION);
 
        if (acpi_disabled) {
                printk(KERN_INFO PREFIX "Interpreter disabled.\n");
@@ -767,7 +758,8 @@ static int __init acpi_init (void)
                if (!PM_IS_ACTIVE())
                        pm_active = 1;
                else {
-                       printk(KERN_INFO PREFIX "APM is already active, exiting\n");
+                       printk(KERN_INFO PREFIX
+                              "APM is already active, exiting\n");
                        disable_acpi();
                        result = -ENODEV;
                }
index 8162fd0..4b6d9f0 100644 (file)
@@ -32,7 +32,6 @@
 #include <acpi/acpi_bus.h>
 #include <acpi/acpi_drivers.h>
 
-
 #define ACPI_BUTTON_COMPONENT          0x00080000
 #define ACPI_BUTTON_DRIVER_NAME                "ACPI Button Driver"
 #define ACPI_BUTTON_CLASS              "button"
@@ -42,7 +41,7 @@
 #define ACPI_BUTTON_NOTIFY_STATUS      0x80
 
 #define ACPI_BUTTON_SUBCLASS_POWER     "power"
-#define ACPI_BUTTON_HID_POWER          "PNP0C0C"       
+#define ACPI_BUTTON_HID_POWER          "PNP0C0C"
 #define ACPI_BUTTON_DEVICE_NAME_POWER  "Power Button (CM)"
 #define ACPI_BUTTON_DEVICE_NAME_POWERF "Power Button (FF)"
 #define ACPI_BUTTON_TYPE_POWER         0x01
 #define ACPI_BUTTON_TYPE_LID           0x05
 
 #define _COMPONENT             ACPI_BUTTON_COMPONENT
-ACPI_MODULE_NAME               ("acpi_button")
+ACPI_MODULE_NAME("acpi_button")
 
-MODULE_AUTHOR("Paul Diefenbaugh");
+    MODULE_AUTHOR("Paul Diefenbaugh");
 MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
-
-static int acpi_button_add (struct acpi_device *device);
-static int acpi_button_remove (struct acpi_device *device, int type);
+static int acpi_button_add(struct acpi_device *device);
+static int acpi_button_remove(struct acpi_device *device, int type);
 static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_button_driver = {
-       .name =         ACPI_BUTTON_DRIVER_NAME,
-       .class =        ACPI_BUTTON_CLASS,
-       .ids =          "ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E",
-       .ops =          {
-                               .add =          acpi_button_add,
-                               .remove =       acpi_button_remove,
-                       },
+       .name = ACPI_BUTTON_DRIVER_NAME,
+       .class = ACPI_BUTTON_CLASS,
+       .ids = "ACPI_FPB,ACPI_FSB,PNP0C0D,PNP0C0C,PNP0C0E",
+       .ops = {
+               .add = acpi_button_add,
+               .remove = acpi_button_remove,
+               },
 };
 
 struct acpi_button {
-       acpi_handle             handle;
-       struct acpi_device      *device;        /* Fixed button kludge */
-       u8                      type;
-       unsigned long           pushed;
+       acpi_handle handle;
+       struct acpi_device *device;     /* Fixed button kludge */
+       u8 type;
+       unsigned long pushed;
 };
 
 static struct file_operations acpi_button_info_fops = {
-       .open           = acpi_button_info_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_button_info_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
 };
 
 static struct file_operations acpi_button_state_fops = {
-       .open           = acpi_button_state_open_fs,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
+       .open = acpi_button_state_open_fs,
+       .read = seq_read,
+       .llseek = seq_lseek,
+       .release = single_release,
 };
+
 /* --------------------------------------------------------------------------
                               FS Interface (/proc)
    -------------------------------------------------------------------------- */
 
-static struct proc_dir_entry   *acpi_button_dir;
+static struct proc_dir_entry *acpi_button_dir;
 
 static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_button      *button = (struct acpi_button *) seq->private;
+       struct acpi_button *button = (struct acpi_button *)seq->private;
 
        ACPI_FUNCTION_TRACE("acpi_button_info_seq_show");
 
        if (!button || !button->device)
                return_VALUE(0);
 
-       seq_printf(seq, "type:                    %s\n", 
-               acpi_device_name(button->device));
+       seq_printf(seq, "type:                    %s\n",
+                  acpi_device_name(button->device));
 
        return_VALUE(0);
 }
@@ -128,24 +127,24 @@ static int acpi_button_info_open_fs(struct inode *inode, struct file *file)
 {
        return single_open(file, acpi_button_info_seq_show, PDE(inode)->data);
 }
-       
+
 static int acpi_button_state_seq_show(struct seq_file *seq, void *offset)
 {
-       struct acpi_button      *button = (struct acpi_button *) seq->private;
-       acpi_status             status;
-       unsigned long           state;
+       struct acpi_button *button = (struct acpi_button *)seq->private;
+       acpi_status status;
+       unsigned long state;
 
        ACPI_FUNCTION_TRACE("acpi_button_state_seq_show");
 
        if (!button || !button->device)
                return_VALUE(0);
 
-       status = acpi_evaluate_integer(button->handle,"_LID",NULL,&state);
+       status = acpi_evaluate_integer(button->handle, "_LID", NULL, &state);
        if (ACPI_FAILURE(status)) {
                seq_printf(seq, "state:      unsupported\n");
-       }
-       else{
-               seq_printf(seq, "state:      %s\n", (state ? "open" : "closed")); 
+       } else {
+               seq_printf(seq, "state:      %s\n",
+                          (state ? "open" : "closed"));
        }
 
        return_VALUE(0);
@@ -160,12 +159,10 @@ static struct proc_dir_entry *acpi_power_dir;
 static struct proc_dir_entry *acpi_sleep_dir;
 static struct proc_dir_entry *acpi_lid_dir;
 
-static int
-acpi_button_add_fs (
-       struct acpi_device      *device)
+static int acpi_button_add_fs(struct acpi_device *device)
 {
-       struct proc_dir_entry   *entry = NULL;
-       struct acpi_button      *button = NULL;
+       struct proc_dir_entry *entry = NULL;
+       struct acpi_button *button = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_button_add_fs");
 
@@ -178,21 +175,21 @@ acpi_button_add_fs (
        case ACPI_BUTTON_TYPE_POWER:
        case ACPI_BUTTON_TYPE_POWERF:
                if (!acpi_power_dir)
-                       acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER, 
-                               acpi_button_dir);
+                       acpi_power_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_POWER,
+                                                   acpi_button_dir);
                entry = acpi_power_dir;
                break;
        case ACPI_BUTTON_TYPE_SLEEP:
        case ACPI_BUTTON_TYPE_SLEEPF:
                if (!acpi_sleep_dir)
-                       acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP, 
-                               acpi_button_dir);
+                       acpi_sleep_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_SLEEP,
+                                                   acpi_button_dir);
                entry = acpi_sleep_dir;
                break;
        case ACPI_BUTTON_TYPE_LID:
                if (!acpi_lid_dir)
-                       acpi_lid_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID, 
-                               acpi_button_dir);
+                       acpi_lid_dir = proc_mkdir(ACPI_BUTTON_SUBCLASS_LID,
+                                                 acpi_button_dir);
                entry = acpi_lid_dir;
                break;
        }
@@ -208,11 +205,11 @@ acpi_button_add_fs (
 
        /* 'info' [R] */
        entry = create_proc_entry(ACPI_BUTTON_FILE_INFO,
-               S_IRUGO, acpi_device_dir(device));
+                                 S_IRUGO, acpi_device_dir(device));
        if (!entry)
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Unable to create '%s' fs entry\n",
-                       ACPI_BUTTON_FILE_INFO));
+                                 "Unable to create '%s' fs entry\n",
+                                 ACPI_BUTTON_FILE_INFO));
        else {
                entry->proc_fops = &acpi_button_info_fops;
                entry->data = acpi_driver_data(device);
@@ -222,11 +219,11 @@ acpi_button_add_fs (
        /* show lid state [R] */
        if (button->type == ACPI_BUTTON_TYPE_LID) {
                entry = create_proc_entry(ACPI_BUTTON_FILE_STATE,
-                       S_IRUGO, acpi_device_dir(device));
+                                         S_IRUGO, acpi_device_dir(device));
                if (!entry)
                        ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Unable to create '%s' fs entry\n",
-                               ACPI_BUTTON_FILE_INFO));
+                                         "Unable to create '%s' fs entry\n",
+                                         ACPI_BUTTON_FILE_INFO));
                else {
                        entry->proc_fops = &acpi_button_state_fops;
                        entry->data = acpi_driver_data(device);
@@ -237,12 +234,9 @@ acpi_button_add_fs (
        return_VALUE(0);
 }
 
-
-static int
-acpi_button_remove_fs (
-       struct acpi_device      *device)
+static int acpi_button_remove_fs(struct acpi_device *device)
 {
-       struct acpi_button      *button = NULL;
+       struct acpi_button *button = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
 
@@ -250,30 +244,25 @@ acpi_button_remove_fs (
        if (acpi_device_dir(device)) {
                if (button->type == ACPI_BUTTON_TYPE_LID)
                        remove_proc_entry(ACPI_BUTTON_FILE_STATE,
-                                            acpi_device_dir(device));
+                                         acpi_device_dir(device));
                remove_proc_entry(ACPI_BUTTON_FILE_INFO,
-                                    acpi_device_dir(device));
+                                 acpi_device_dir(device));
 
                remove_proc_entry(acpi_device_bid(device),
-                                    acpi_device_dir(device)->parent);
+                                 acpi_device_dir(device)->parent);
                acpi_device_dir(device) = NULL;
        }
 
        return_VALUE(0);
 }
 
-
 /* --------------------------------------------------------------------------
                                 Driver Interface
    -------------------------------------------------------------------------- */
 
-static void
-acpi_button_notify (
-       acpi_handle             handle,
-       u32                     event,
-       void                    *data)
+static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 {
-       struct acpi_button      *button = (struct acpi_button *) data;
+       struct acpi_button *button = (struct acpi_button *)data;
 
        ACPI_FUNCTION_TRACE("acpi_button_notify");
 
@@ -282,24 +271,22 @@ acpi_button_notify (
 
        switch (event) {
        case ACPI_BUTTON_NOTIFY_STATUS:
-               acpi_bus_generate_event(button->device, event, ++button->pushed);
+               acpi_bus_generate_event(button->device, event,
+                                       ++button->pushed);
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                       "Unsupported event [0x%x]\n", event));
+                                 "Unsupported event [0x%x]\n", event));
                break;
        }
 
        return_VOID;
 }
 
-
-static acpi_status
-acpi_button_notify_fixed (
-       void                    *data)
+static acpi_status acpi_button_notify_fixed(void *data)
 {
-       struct acpi_button      *button = (struct acpi_button *) data;
-       
+       struct acpi_button *button = (struct acpi_button *)data;
+
        ACPI_FUNCTION_TRACE("acpi_button_notify_fixed");
 
        if (!button)
@@ -310,14 +297,11 @@ acpi_button_notify_fixed (
        return_ACPI_STATUS(AE_OK);
 }
 
-
-static int
-acpi_button_add (
-       struct acpi_device      *device)
+static int acpi_button_add(struct acpi_device *device)
 {
-       int                     result = 0;
-       acpi_status             status = AE_OK;
-       struct acpi_button      *button = NULL;
+       int result = 0;
+       acpi_status status = AE_OK;
+       struct acpi_button *button = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_button_add");
 
@@ -339,42 +323,34 @@ acpi_button_add (
         */
        if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWER)) {
                button->type = ACPI_BUTTON_TYPE_POWER;
-               strcpy(acpi_device_name(device),
-                       ACPI_BUTTON_DEVICE_NAME_POWER);
-               sprintf(acpi_device_class(device), "%s/%s", 
+               strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_POWER);
+               sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
-       }
-       else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
+       } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF)) {
                button->type = ACPI_BUTTON_TYPE_POWERF;
                strcpy(acpi_device_name(device),
-                       ACPI_BUTTON_DEVICE_NAME_POWERF);
-               sprintf(acpi_device_class(device), "%s/%s", 
+                      ACPI_BUTTON_DEVICE_NAME_POWERF);
+               sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_POWER);
-       }
-       else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
+       } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEP)) {
                button->type = ACPI_BUTTON_TYPE_SLEEP;
-               strcpy(acpi_device_name(device),
-                       ACPI_BUTTON_DEVICE_NAME_SLEEP);
-               sprintf(acpi_device_class(device), "%s/%s", 
+               strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_SLEEP);
+               sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
-       }
-       else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
+       } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF)) {
                button->type = ACPI_BUTTON_TYPE_SLEEPF;
                strcpy(acpi_device_name(device),
-                       ACPI_BUTTON_DEVICE_NAME_SLEEPF);
-               sprintf(acpi_device_class(device), "%s/%s", 
+                      ACPI_BUTTON_DEVICE_NAME_SLEEPF);
+               sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_SLEEP);
-       }
-       else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
+       } else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_LID)) {
                button->type = ACPI_BUTTON_TYPE_LID;
-               strcpy(acpi_device_name(device),
-                       ACPI_BUTTON_DEVICE_NAME_LID);
-               sprintf(acpi_device_class(device), "%s/%s", 
+               strcpy(acpi_device_name(device), ACPI_BUTTON_DEVICE_NAME_LID);
+               sprintf(acpi_device_class(device), "%s/%s",
                        ACPI_BUTTON_CLASS, ACPI_BUTTON_SUBCLASS_LID);
-       }
-       else {
+       } else {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Unsupported hid [%s]\n",
-                       acpi_device_hid(device)));
+                                 acpi_device_hid(device)));
                result = -ENODEV;
                goto end;
        }
@@ -385,46 +361,46 @@ acpi_button_add (
 
        switch (button->type) {
        case ACPI_BUTTON_TYPE_POWERF:
-               status = acpi_install_fixed_event_handler (
-                       ACPI_EVENT_POWER_BUTTON,
-                       acpi_button_notify_fixed,
-                       button);
+               status =
+                   acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
+                                                    acpi_button_notify_fixed,
+                                                    button);
                break;
        case ACPI_BUTTON_TYPE_SLEEPF:
-               status = acpi_install_fixed_event_handler (
-                       ACPI_EVENT_SLEEP_BUTTON,
-                       acpi_button_notify_fixed,
-                       button);
+               status =
+                   acpi_install_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
+                                                    acpi_button_notify_fixed,
+                                                    button);
                break;
        default:
-               status = acpi_install_notify_handler (
-                       button->handle,
-                       ACPI_DEVICE_NOTIFY,
-                       acpi_button_notify,
-                       button);
+               status = acpi_install_notify_handler(button->handle,
+                                                    ACPI_DEVICE_NOTIFY,
+                                                    acpi_button_notify,
+                                                    button);
                break;
        }
 
        if (ACPI_FAILURE(status)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error installing notify handler\n"));
+                                 "Error installing notify handler\n"));
                result = -ENODEV;
                goto end;
        }
 
        if (device->wakeup.flags.valid) {
                /* Button's GPE is run-wake GPE */
-               acpi_set_gpe_type(device->wakeup.gpe_device, 
-                       device->wakeup.gpe_number, ACPI_GPE_TYPE_WAKE_RUN);
-               acpi_enable_gpe(device->wakeup.gpe_device, 
-                       device->wakeup.gpe_number, ACPI_NOT_ISR);
+               acpi_set_gpe_type(device->wakeup.gpe_device,
+                                 device->wakeup.gpe_number,
+                                 ACPI_GPE_TYPE_WAKE_RUN);
+               acpi_enable_gpe(device->wakeup.gpe_device,
+                               device->wakeup.gpe_number, ACPI_NOT_ISR);
                device->wakeup.state.enabled = 1;
        }
 
-       printk(KERN_INFO PREFIX "%s [%s]\n", 
-               acpi_device_name(device), acpi_device_bid(device));
+       printk(KERN_INFO PREFIX "%s [%s]\n",
+              acpi_device_name(device), acpi_device_bid(device));
 
-end:
+      end:
        if (result) {
                acpi_button_remove_fs(device);
                kfree(button);
@@ -433,12 +409,10 @@ end:
        return_VALUE(result);
 }
 
-
-static int
-acpi_button_remove (struct acpi_device *device, int type)
+static int acpi_button_remove(struct acpi_device *device, int type)
 {
-       acpi_status             status = 0;
-       struct acpi_button      *button = NULL;
+       acpi_status status = 0;
+       struct acpi_button *button = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_button_remove");
 
@@ -450,35 +424,36 @@ acpi_button_remove (struct acpi_device *device, int type)
        /* Unregister for device notifications. */
        switch (button->type) {
        case ACPI_BUTTON_TYPE_POWERF:
-               status = acpi_remove_fixed_event_handler(
-                       ACPI_EVENT_POWER_BUTTON, acpi_button_notify_fixed);
+               status =
+                   acpi_remove_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
+                                                   acpi_button_notify_fixed);
                break;
        case ACPI_BUTTON_TYPE_SLEEPF:
-               status = acpi_remove_fixed_event_handler(
-                       ACPI_EVENT_SLEEP_BUTTON, acpi_button_notify_fixed);
+               status =
+                   acpi_remove_fixed_event_handler(ACPI_EVENT_SLEEP_BUTTON,
+                                                   acpi_button_notify_fixed);
                break;
        default:
                status = acpi_remove_notify_handler(button->handle,
-                       ACPI_DEVICE_NOTIFY, acpi_button_notify);
+                                                   ACPI_DEVICE_NOTIFY,
+                                                   acpi_button_notify);
                break;
        }
 
        if (ACPI_FAILURE(status))
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                       "Error removing notify handler\n"));
+                                 "Error removing notify handler\n"));
 
-       acpi_button_remove_fs(device);  
+       acpi_button_remove_fs(device);
 
        kfree(button);
 
        return_VALUE(0);
 }
 
-
-static int __init
-acpi_button_init (void)
+static int __init acpi_button_init(void)
 {
-       int                     result = 0;
+       int result = 0;
 
        ACPI_FUNCTION_TRACE("acpi_button_init");
 
@@ -495,15 +470,13 @@ acpi_button_init (void)
        return_VALUE(0);
 }
 
-
-static void __exit
-acpi_button_exit (void)
+static void __exit acpi_button_exit(void)
 {
        ACPI_FUNCTION_TRACE("acpi_button_exit");
 
        acpi_bus_unregister_driver(&acpi_button_driver);
 
-       if (acpi_power_dir) 
+       if (acpi_power_dir)
                remove_proc_entry(ACPI_BUTTON_SUBCLASS_POWER, acpi_button_dir);
        if (acpi_sleep_dir)
                remove_proc_entry(ACPI_BUTTON_SUBCLASS_SLEEP, acpi_button_dir);
@@ -514,6 +487,5 @@ acpi_button_exit (void)
        return_VOID;
 }
 
-
 module_init(acpi_button_init);
 module_exit(acpi_button_exit);
index 97013dd..10dd695 100644 (file)
@@ -44,9 +44,9 @@
 
 #define ACPI_CONTAINER_COMPONENT       0x01000000
 #define _COMPONENT                     ACPI_CONTAINER_COMPONENT
-ACPI_MODULE_NAME                       ("acpi_container")
+ACPI_MODULE_NAME("acpi_container")
 
-MODULE_AUTHOR("Anil S Keshavamurthy");
+    MODULE_AUTHOR("Anil S Keshavamurthy");
 MODULE_DESCRIPTION(ACPI_CONTAINER_DRIVER_NAME);
 MODULE_LICENSE("GPL");
 
@@ -56,41 +56,38 @@ static int acpi_container_add(struct acpi_device *device);
 static int acpi_container_remove(struct acpi_device *device, int type);
 
 static struct acpi_driver acpi_container_driver = {
-       .name =         ACPI_CONTAINER_DRIVER_NAME,
-       .class =        ACPI_CONTAINER_CLASS,
-       .ids =          "ACPI0004,PNP0A05,PNP0A06",
-       .ops =          {
-                               .add =          acpi_container_add,
-                               .remove =       acpi_container_remove,
-                       },
+       .name = ACPI_CONTAINER_DRIVER_NAME,
+       .class = ACPI_CONTAINER_CLASS,
+       .ids = "ACPI0004,PNP0A05,PNP0A06",
+       .ops = {
+               .add = acpi_container_add,
+               .remove = acpi_container_remove,
+               },
 };
 
-
 /*******************************************************************/
 
-static int
-is_device_present(acpi_handle handle)
+static int is_device_present(acpi_handle handle)
 {
-       acpi_handle             temp;
-       acpi_status             status;
-       unsigned long   sta;
+       acpi_handle temp;
+       acpi_status status;
+       unsigned long sta;
 
        ACPI_FUNCTION_TRACE("is_device_present");
 
        status = acpi_get_handle(handle, "_STA", &temp);
        if (ACPI_FAILURE(status))
-               return_VALUE(1); /* _STA not found, assmue device present */
+               return_VALUE(1);        /* _STA not found, assmue device present */
 
        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status))
-               return_VALUE(0); /* Firmware error */
+               return_VALUE(0);        /* Firmware error */
 
        return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
 }
 
 /*******************************************************************/
-static int
-acpi_container_add(struct acpi_device *device)
+static int acpi_container_add(struct acpi_device *device)
 {
        struct acpi_container *container;
 
@@ -102,28 +99,26 @@ acpi_container_add(struct acpi_device *device)
        }
 
        container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
-       if(!container)
+       if (!container)
                return_VALUE(-ENOMEM);
-       
+
        memset(container, 0, sizeof(struct acpi_container));
        container->handle = device->handle;
        strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME);
        strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS);
        acpi_driver_data(device) = container;
 
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",       \
-               acpi_device_name(device), acpi_device_bid(device)));
-
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
+                         acpi_device_name(device), acpi_device_bid(device)));
 
        return_VALUE(0);
 }
 
-static int
-acpi_container_remove(struct acpi_device *device, int type)
+static int acpi_container_remove(struct acpi_device *device, int type)
 {
-       acpi_status             status = AE_OK;
-       struct acpi_container   *pc = NULL;
-       pc = (struct acpi_container*) acpi_driver_data(device);
+       acpi_status status = AE_OK;
+       struct acpi_container *pc = NULL;
+       pc = (struct acpi_container *)acpi_driver_data(device);
 
        if (pc)
                kfree(pc);
@@ -131,9 +126,7 @@ acpi_container_remove(struct acpi_device *device, int type)
        return status;
 }
 
-
-static int
-container_device_add(struct acpi_device **device, acpi_handle handle)
+static int container_device_add(struct acpi_device **device, acpi_handle handle)
 {
        acpi_handle phandle;
        struct acpi_device *pdev;
@@ -158,10 +151,9 @@ container_device_add(struct acpi_device **device, acpi_handle handle)
        return_VALUE(result);
 }
 
-static void
-container_notify_cb(acpi_handle handle, u32 type, void *context)
+static void container_notify_cb(acpi_handle handle, u32 type, void *context)
 {
-       struct acpi_device              *device = NULL;
+       struct acpi_device *device = NULL;
        int result;
        int present;
        acpi_status status;
@@ -169,14 +161,14 @@ container_notify_cb(acpi_handle handle, u32 type, void *context)
        ACPI_FUNCTION_TRACE("container_notify_cb");
 
        present = is_device_present(handle);
-       
+
        switch (type) {
        case ACPI_NOTIFY_BUS_CHECK:
                /* Fall through */
        case ACPI_NOTIFY_DEVICE_CHECK:
                printk("Container driver received %s event\n",
-                       (type == ACPI_NOTIFY_BUS_CHECK)?
-                       "ACPI_NOTIFY_BUS_CHECK":"ACPI_NOTIFY_DEVICE_CHECK");
+                      (type == ACPI_NOTIFY_BUS_CHECK) ?
+                      "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
                status = acpi_bus_get_device(handle, &device);
                if (present) {
                        if (ACPI_FAILURE(status) || !device) {
@@ -207,15 +199,13 @@ container_notify_cb(acpi_handle handle, u32 type, void *context)
 
 static acpi_status
 container_walk_namespace_cb(acpi_handle handle,
-       u32 lvl,
-       void *context,
-       void **rv)
+                           u32 lvl, void *context, void **rv)
 {
-       char                            *hid = NULL;
-       struct acpi_buffer              buffer = {ACPI_ALLOCATE_BUFFER, NULL};
-       struct acpi_device_info         *info;
-       acpi_status                     status;
-       int                             *action = context;
+       char *hid = NULL;
+       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+       struct acpi_device_info *info;
+       acpi_status status;
+       int *action = context;
 
        ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
 
@@ -233,66 +223,60 @@ container_walk_namespace_cb(acpi_handle handle,
        }
 
        if (strcmp(hid, "ACPI0004") && strcmp(hid, "PNP0A05") &&
-                       strcmp(hid, "PNP0A06")) {
+           strcmp(hid, "PNP0A06")) {
                goto end;
        }
 
-       switch(*action) {
+       switch (*action) {
        case INSTALL_NOTIFY_HANDLER:
                acpi_install_notify_handler(handle,
-                       ACPI_SYSTEM_NOTIFY,
-                       container_notify_cb,
-                       NULL);
+                                           ACPI_SYSTEM_NOTIFY,
+                                           container_notify_cb, NULL);
                break;
        case UNINSTALL_NOTIFY_HANDLER:
                acpi_remove_notify_handler(handle,
-                       ACPI_SYSTEM_NOTIFY,
-     &nb