]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ACPI / ACPICA: Simplify acpi_ev_initialize_gpe_block()
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 7 Jul 2010 22:44:42 +0000 (00:44 +0200)
committerLen Brown <len.brown@intel.com>
Mon, 12 Jul 2010 18:33:35 +0000 (14:33 -0400)
Simplify the main loop in acpi_ev_initialize_gpe_block() by
rearranging code and removing the "enabled" label that is not
necessary any more.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/evgpeblk.c

index 12ca1bc5f1fddf0a6dc2c9c4ebe7f655c20de142..85445fb5844e503fe1a7f9282afafd3bb7cd4740 100644 (file)
@@ -472,26 +472,21 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
                        gpe_event_info = &gpe_block->event_info[gpe_index];
                        gpe_number = gpe_index + gpe_block->block_base_number;
 
-                       /*
-                        * If the GPE has already been enabled for runtime
-                        * signaling, make sure it remains enabled, but do not
-                        * increment its reference counter.
-                        */
-                       if (gpe_event_info->runtime_count) {
-                               status = acpi_ev_enable_gpe(gpe_event_info);
-                               goto enabled;
-                       }
-
                        /* Ignore GPEs that have no corresponding _Lxx/_Exx method */
 
                        if (!(gpe_event_info->flags & ACPI_GPE_DISPATCH_METHOD)) {
                                continue;
                        }
 
-                       /* Enable this GPE */
+                       /*
+                        * If the GPE has already been enabled for runtime
+                        * signaling, make sure it remains enabled, but do not
+                        * increment its reference counter.
+                        */
+                       status = gpe_event_info->runtime_count ?
+                               acpi_ev_enable_gpe(gpe_event_info) :
+                               acpi_enable_gpe(gpe_device, gpe_number);
 
-                       status = acpi_enable_gpe(gpe_device, gpe_number);
-                     enabled:
                        if (ACPI_FAILURE(status)) {
                                ACPI_EXCEPTION((AE_INFO, status,
                                                "Could not enable GPE 0x%02X",