diff options
author | Quentin Lambert <lambert.quentin@gmail.com> | 2014-09-07 22:03:32 +0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-09-24 17:50:53 +0400 |
commit | 79e50e72986c9fcb06d707ce587cfd24fefa33e3 (patch) | |
tree | 1a21fd09d544924c1bc1417840a8569821820516 /drivers/pci/hotplug/cpci_hotplug_core.c | |
parent | 656f978f9af9d8d77436e8159f51f7aa1e673309 (diff) | |
download | linux-79e50e72986c9fcb06d707ce587cfd24fefa33e3.tar.xz |
PCI: Remove assignment from "if" conditions
The following Coccinelle semantic patch was used to find and correct cases
of assignments in "if" conditions:
@@
expression var, expr;
statement S;
@@
+ var = expr;
if(
- (var = expr)
+ var
) S
Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/cpci_hotplug_core.c')
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 8359e29156ea..a5a7fd8332ac 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c @@ -125,7 +125,8 @@ disable_slot(struct hotplug_slot *hotplug_slot) /* Unconfigure device */ dbg("%s - unconfiguring slot %s", __func__, slot_name(slot)); - if ((retval = cpci_unconfigure_slot(slot))) { + retval = cpci_unconfigure_slot(slot); + if (retval) { err("%s - could not unconfigure slot %s", __func__, slot_name(slot)); goto disable_error; @@ -141,9 +142,11 @@ disable_slot(struct hotplug_slot *hotplug_slot) } cpci_led_on(slot); - if (controller->ops->set_power) - if ((retval = controller->ops->set_power(slot, 0))) + if (controller->ops->set_power) { + retval = controller->ops->set_power(slot, 0); + if (retval) goto disable_error; + } if (update_adapter_status(slot->hotplug_slot, 0)) warn("failure to update adapter file"); |