[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200731110240.98326-6-refactormyself@gmail.com>
Date: Fri, 31 Jul 2020 13:02:33 +0200
From: "Saheed O. Bolarinwa" <refactormyself@...il.com>
To: helgaas@...nel.org
Cc: "Saheed O. Bolarinwa" <refactormyself@...il.com>,
bjorn@...gaas.com, skhan@...uxfoundation.org,
linux-pci@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 05/12] PCI: pciehp: Set "Power On" as the default get_power_status
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@...gaas.com>
Signed-off-by: Saheed O. Bolarinwa <refactormyself@...il.com>
---
drivers/pci/hotplug/pciehp_hpc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
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;
}
}
--
2.18.4
Powered by blists - more mailing lists