summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2018-07-28 07:22:00 +0200
committerBjorn Helgaas <bhelgaas@google.com>2018-07-31 13:26:33 -0500
commit8bb46b079d05be4435892869dad23e9af23098ab (patch)
tree6c30db6932ae3dae9fe835474e98f549fbc0c158
parent47a8e237ed443c174f8f73402755c458c56eb611 (diff)
downloadop-kernel-dev-8bb46b079d05be4435892869dad23e9af23098ab.zip
op-kernel-dev-8bb46b079d05be4435892869dad23e9af23098ab.tar.gz
PCI: pciehp: Avoid implicit fallthroughs in switch statements
Per Mika's request, add an explicit break to the last case of switch statements everywhere in pciehp to be more defensive towards future amendments. Per Gustavo's request, mark all non-empty implicit fallthroughs with a comment to silence warnings triggered by -Wimplicit-fallthrough=2. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index 6855933..da7c723 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -211,6 +211,7 @@ void pciehp_handle_disable_request(struct slot *slot)
case BLINKINGON_STATE:
case BLINKINGOFF_STATE:
cancel_delayed_work(&slot->work);
+ break;
}
slot->state = POWEROFF_STATE;
mutex_unlock(&slot->lock);
@@ -232,6 +233,7 @@ void pciehp_handle_presence_or_link_change(struct slot *slot, u32 events)
switch (slot->state) {
case BLINKINGOFF_STATE:
cancel_delayed_work(&slot->work);
+ /* fall through */
case ON_STATE:
slot->state = POWEROFF_STATE;
mutex_unlock(&slot->lock);
@@ -245,6 +247,7 @@ void pciehp_handle_presence_or_link_change(struct slot *slot, u32 events)
break;
default:
mutex_unlock(&slot->lock);
+ break;
}
/* Turn the slot on if it's occupied or link is up */
@@ -259,6 +262,7 @@ void pciehp_handle_presence_or_link_change(struct slot *slot, u32 events)
switch (slot->state) {
case BLINKINGON_STATE:
cancel_delayed_work(&slot->work);
+ /* fall through */
case OFF_STATE:
slot->state = POWERON_STATE;
mutex_unlock(&slot->lock);
@@ -272,6 +276,7 @@ void pciehp_handle_presence_or_link_change(struct slot *slot, u32 events)
break;
default:
mutex_unlock(&slot->lock);
+ break;
}
}
OpenPOWER on IntegriCloud