diff mbox series

[v4,05/12] PCI: pciehp: Set "Power On" as the default get_power_status

Message ID 20200731110240.98326-6-refactormyself@gmail.com
State New
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Remove '*val = 0' from pcie_capability_read_*() | expand

Commit Message

Saheed Olayemi Bolarinwa July 31, 2020, 11:02 a.m. UTC
The default case of the switch statement is redundant since
PCI_EXP_SLTCTL_PCC is only a single bit.

Set the default case in the switch-statement to set status
to "Power On"

Suggested-by: Bjorn Helgaas <bjorn@helgaas.com>
Signed-off-by: Saheed O. Bolarinwa <refactormyself@gmail.com>
---
 drivers/pci/hotplug/pciehp_hpc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 53433b37e181..b89c9ee4a3b5 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -400,14 +400,12 @@  void pciehp_get_power_status(struct controller *ctrl, u8 *status)
 		 pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_ctrl);
 
 	switch (slot_ctrl & PCI_EXP_SLTCTL_PCC) {
-	case PCI_EXP_SLTCTL_PWR_ON:
-		*status = 1;	/* On */
-		break;
 	case PCI_EXP_SLTCTL_PWR_OFF:
 		*status = 0;	/* Off */
 		break;
+	case PCI_EXP_SLTCTL_PWR_ON:
 	default:
-		*status = 0xFF;
+		*status = 1;	/* On */
 		break;
 	}
 }