acpi: Minor style changes
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 22 Mar 2011 02:48:48 +0000 (10:48 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 27 Mar 2011 10:34:01 +0000 (18:34 +0800)
sys/dev/acpica5/Makefile
sys/dev/acpica5/Osd/OsdHardware.c
sys/dev/acpica5/acpi.c
sys/dev/acpica5/acpi_ec.c
sys/dev/acpica5/acpi_pci.c
sys/dev/acpica5/acpi_video/acpi_video.c

index 6238cab..2332acc 100644 (file)
@@ -39,7 +39,7 @@ SRCS+=        dmresrcs.c dmutils.c dmwalk.c
 SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c
 SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c
 SRCS+= dswscope.c dswstate.c dsargs.c dscontrol.c dswload2.c
-SRCS+=  evevent.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c evxfgpe.c
+SRCS+= evevent.c evgpe.c evgpeblk.c evgpeinit.c evgpeutil.c evxfgpe.c
 SRCS+= evmisc.c evregion.c evrgnini.c evsci.c evxface.c
 SRCS+= evxfevnt.c evxfregn.c exconfig.c exconvrt.c excreate.c
 SRCS+= exdump.c exfield.c exfldio.c exmisc.c exmutex.c
index cecd6da..f96e07c 100644 (file)
@@ -114,13 +114,13 @@ AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, UINT64 *Value,
     int bytes = Width / 8;
 
     if (Width == 64)
-        return (AE_SUPPORT);
+       return (AE_SUPPORT);
 
     if (!pci_cfgregopen())
         return (AE_NOT_EXIST);
 
     *(UINT64 *)Value = pci_cfgregread(PciId->Bus, PciId->Device,
-                                      PciId->Function, Register, bytes);
+                                     PciId->Function, Register, bytes);
     *Value &= (1 << (bytes * 8)) - 1;
 
     return (AE_OK);
@@ -132,13 +132,13 @@ AcpiOsWritePciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register,
     UINT64 Value, UINT32 Width)
 {
     if (Width == 64)
-        return (AE_SUPPORT);
+       return (AE_SUPPORT);
 
     if (!pci_cfgregopen())
        return (AE_NOT_EXIST);
 
     pci_cfgregwrite(PciId->Bus, PciId->Device, PciId->Function, Register,
-                    (u_int32_t) Value, Width / 8); /* XXX casting */
+                   (u_int32_t)Value, Width / 8); /* XXX casting */
 
     return (AE_OK);
 }
index 50a7868..4c9f060 100644 (file)
@@ -653,9 +653,10 @@ acpi_attach(device_t dev)
 
     /* Update all GPEs and enable runtime GPEs. */
     status = AcpiUpdateAllGpes();
-    if (ACPI_FAILURE(status))
-        device_printf(dev, "Could not update all GPEs: %s\n",
-                      AcpiFormatException(status));
+    if (ACPI_FAILURE(status)) {
+       device_printf(dev, "Could not update all GPEs: %s\n",
+                     AcpiFormatException(status));
+    }
 
     /* Allow sleep request after a while. */
     /* timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); */
@@ -857,16 +858,16 @@ acpi_child_pnpinfo_str_method(device_t cbdev, device_t child, char *buf,
     int error;
 
     error = AcpiGetObjectInfo(dinfo->ad_handle, &adinfo);
-    if (error)
+    if (error) {
        ksnprintf(buf, buflen, "unknown");
-    else {
+    else {
        ksnprintf(buf, buflen, "_HID=%s _UID=%lu",
                 (adinfo->Valid & ACPI_VALID_HID) ?
                 adinfo->HardwareId.String : "none",
                 (adinfo->Valid & ACPI_VALID_UID) ?
                 strtoul(adinfo->UniqueId.String, &end, 10) : 0);
-    if (adinfo)
-       AcpiOsFree(adinfo);
+       if (adinfo)
+           AcpiOsFree(adinfo);
     }
     return (0);
 }
@@ -1224,7 +1225,7 @@ acpi_isa_get_logicalid(device_t dev)
 
 out:
     if (devinfo)
-    AcpiOsFree(devinfo);
+       AcpiOsFree(devinfo);
     return_VALUE (pnpid);
 }
 
@@ -1543,7 +1544,7 @@ acpi_probe_children(device_t bus)
      */
     ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "namespace scan\n"));
     AcpiWalkNamespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 100, NULL,
-                      acpi_probe_child,        bus, NULL);
+       acpi_probe_child, bus, NULL);
 
     /* Pre-allocate resources for our rman from any sysresource devices. */
     acpi_sysres_alloc(bus);
@@ -1612,7 +1613,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
     ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
 
     if (acpi_disabled("children"))
-        return_ACPI_STATUS (AE_OK);
+       return_ACPI_STATUS (AE_OK);
 
     /* Skip this device if we think we'll have trouble with it. */
     if (acpi_avoid(handle))
@@ -1620,7 +1621,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
 
     bus = (device_t)context;
     if (ACPI_SUCCESS(AcpiGetType(handle, &type))) {
-        handle_str = acpi_name(handle);
+       handle_str = acpi_name(handle);
        switch (type) {
        case ACPI_TYPE_DEVICE:
        case ACPI_TYPE_PROCESSOR:
@@ -1637,8 +1638,8 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
            if (*search != NULL)
                break;
 
-        if (type == ACPI_TYPE_DEVICE && acpi_parse_prw(handle, &prw) == 0)
-            AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit);
+           if (type == ACPI_TYPE_DEVICE && acpi_parse_prw(handle, &prw) == 0)
+               AcpiSetupGpeForWake(handle, prw.gpe_handle, prw.gpe_bit);
 
            /* 
             * Create a placeholder device for this node.  Sort the
@@ -2494,7 +2495,7 @@ acpi_wake_set_enable(device_t dev, int enable)
 
     flags = acpi_get_flags(dev);
     if (enable) {
-        status = AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit,
+       status = AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit,
                                     ACPI_GPE_ENABLE);
        if (ACPI_FAILURE(status)) {
            device_printf(dev, "enable wake failed\n");
@@ -2502,7 +2503,7 @@ acpi_wake_set_enable(device_t dev, int enable)
        }
        acpi_set_flags(dev, flags | ACPI_FLAG_WAKE_ENABLED);
     } else {
-        status = AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit,
+       status = AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit,
                                     ACPI_GPE_DISABLE);
        if (ACPI_FAILURE(status)) {
            device_printf(dev, "disable wake failed\n");
@@ -2533,7 +2534,7 @@ acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate)
      * and set _PSW.
      */
     if (sstate > prw.lowest_wake) {
-        AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_DISABLE);
+       AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_DISABLE);
        if (bootverbose)
            device_printf(dev, "wake_prep disabled wake for %s (S%d)\n",
                acpi_name(handle), sstate);
@@ -2570,7 +2571,7 @@ acpi_wake_run_prep(ACPI_HANDLE handle, int sstate)
      * clear _PSW and turn off any power resources it used.
      */
     if (sstate > prw.lowest_wake) {
-        AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_ENABLE);
+       AcpiSetGpeWakeMask(prw.gpe_handle, prw.gpe_bit, ACPI_GPE_ENABLE);
        if (bootverbose)
            device_printf(dev, "run_prep re-enabled %s\n", acpi_name(handle));
     } else {
@@ -2604,9 +2605,10 @@ acpi_wake_prep_walk(int sstate)
 {
     ACPI_HANDLE sb_handle;
 
-    if (ACPI_SUCCESS(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle)))
-    AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, 100, NULL,
+    if (ACPI_SUCCESS(AcpiGetHandle(ACPI_ROOT_OBJECT, "\\_SB_", &sb_handle))) {
+       AcpiWalkNamespace(ACPI_TYPE_DEVICE, sb_handle, 100, NULL,
            acpi_wake_prep, &sstate, NULL);
+    }
     return (0);
 }
 
index 7d4f02e..87254b0 100644 (file)
@@ -661,10 +661,11 @@ EcGpeQueryHandler(void *Context)
 
     /* Reenable runtime GPE if its execution was deferred. */
     if (sc->ec_sci_pend) {
-        Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit);
-        if (ACPI_FAILURE(Status))
-            device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n",
-                          AcpiFormatException(Status));
+       Status = AcpiFinishGpe(sc->ec_gpehandle, sc->ec_gpebit);
+       if (ACPI_FAILURE(Status)) {
+           device_printf(sc->ec_dev, "reenabling runtime GPE failed: %s\n",
+               AcpiFormatException(Status));
+       }
     }
 }
 
index 3936d0d..4aeb28b 100644 (file)
@@ -344,7 +344,7 @@ acpi_pci_attach(device_t dev)
         */
        pci_add_children(dev, domain, busno, sizeof(struct acpi_pci_devinfo));
        AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1,
-        NULL, acpi_pci_save_handle, dev, NULL);
+           NULL, acpi_pci_save_handle, dev, NULL);
 
        return (bus_generic_attach(dev));
 }
index 3e58e5c..9dd5046 100644 (file)
@@ -807,7 +807,7 @@ vid_enum_outputs(ACPI_HANDLE handle,
        argset.dod_pkg  = res;
        argset.count    = 0;
        status = AcpiWalkNamespace(ACPI_TYPE_DEVICE, handle, 1,
-        NULL, vid_enum_outputs_subr, &argset, NULL);
+           NULL, vid_enum_outputs_subr, &argset, NULL);
        if (ACPI_FAILURE(status))
                kprintf("failed walking down %s - %s\n",
                       acpi_name(handle), AcpiFormatException(status));