提交 248d4903 编写于 作者: F Frans Klaver 提交者: Darren Hart

eeepc-laptop: flatten control flow

In eeepc_rfkill_hotplug there's an if statement with a big tail that
ends right before the out_unlock label. We might as well invert the
condition and jump to out_unlock in that case, pretty much like the rest
of the code does. This removes an indentation level for a large chunk of
code and also stops suggesting there might be an else clause.
Signed-off-by: NFrans Klaver <fransklaver@gmail.com>
Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
上级 98280374
...@@ -580,7 +580,9 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) ...@@ -580,7 +580,9 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
mutex_lock(&eeepc->hotplug_lock); mutex_lock(&eeepc->hotplug_lock);
pci_lock_rescan_remove(); pci_lock_rescan_remove();
if (eeepc->hotplug_slot) { if (!eeepc->hotplug_slot)
goto out_unlock;
port = acpi_get_pci_dev(handle); port = acpi_get_pci_dev(handle);
if (!port) { if (!port) {
pr_warning("Unable to find port\n"); pr_warning("Unable to find port\n");
...@@ -632,7 +634,6 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) ...@@ -632,7 +634,6 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
} }
out_put_dev: out_put_dev:
pci_dev_put(port); pci_dev_put(port);
}
out_unlock: out_unlock:
pci_unlock_rescan_remove(); pci_unlock_rescan_remove();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册