MIPS: BCM63XX: Mark expected switch fall-through
PATCH 1/1 MIPS: BCM63XX: Mark expected switch fall-through
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning (Building: bcm63xx_defconfig mips):
arch/mips/pci/ops-bcm63xx.c: In function ‘bcm63xx_pcie_can_access’:arch/mips/pci/ops-bcm63xx.c:474:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (PCI_SLOT(devfn) == 0)
^
arch/mips/pci/ops-bcm63xx.c:477:2: note: here
default:
^~~~~~~
--- arch/mips/pci/ops-bcm63xx.c | 1 + 1 file changed, 1 insertion(+)
arch/mips/pci/ops-bcm63xx.c +1 -0
@@ -474,6 +474,7 @@ static int bcm63xx_pcie_can_access(struct pci_bus *bus, int devfn)if (PCI_SLOT (devfn) ==0 )return bcm_pcie_readl (PCIE_DLSTATUS_REG ) &DLSTATUS_PHYLINKUP ; +/* else, fall through */ default :return false; }
Signature · 1 line
2.22.0
Quoted 22 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning (Building:
bcm63xx_defconfigmips):
arch/mips/pci/ops-bcm63xx.c: In function ‘bcm63xx_pcie_can_access’:arch/mips/pci/ops-bcm63xx.c:474:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (PCI_SLOT(devfn)== 0)^
arch/mips/pci/ops-bcm63xx.c:477:2: note: here
default:
^~~~~~~Signed-off-by Gustavo A. R. Silva <[email protected]>--- arch/mips/pci/ops-bcm63xx.c | 1 + 1 file changed, 1 insertion(+)arch/mips/pci/ops-bcm63xx.c +0
-0
arch/mips/pci/ops-bcm63xx.c static int bcm63xx_pcie_can_access(struct pci_bus *bus, int devfn) · line 480
Quoted 7 lines
arch/mips/pci/ops-bcm63xx.c +1
-0@@ -474,6 +474,7 @@ static int bcm63xx_pcie_can_access(struct pci_bus *bus, int devfn)if (PCI_SLOT (devfn) ==0 )return bcm_pcie_readl (PCIE_DLSTATUS_REG ) &DLSTATUS_PHYLINKUP ; +/* else, fall through */ default :return false; }
Perhaps clearer as:
--- arch/mips/pci/ops-bcm63xx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
arch/mips/pci/ops-bcm63xx.c +4 -5
@@ -471,12 +471,11 @@ static int bcm63xx_pcie_can_access(struct pci_bus *bus, int devfn)case PCIE_BUS_BRIDGE :return PCI_SLOT (devfn) ==0 ;case PCIE_BUS_DEVICE : -if (PCI_SLOT (devfn) ==0 ) -return bcm_pcie_readl (PCIE_DLSTATUS_REG ) - &DLSTATUS_PHYLINKUP ; -default : -return false; +return PCI_SLOT (devfn) ==0 && +bcm_pcie_readl (PCIE_DLSTATUS_REG ) &DLSTATUS_PHYLINKUP ; } + +return false; } static int bcm63xx_pcie_read(struct pci_bus *bus, unsigned int devfn,
Paul Burton
AppliedHello,
Quoted 12 lines · Gustavo A. R. Silva
Mark switch cases where we are expecting to fall through.
This patch fixes the following warning (Building:
bcm63xx_defconfigmips):
arch/mips/pci/ops-bcm63xx.c: In function ‘bcm63xx_pcie_can_access’:arch/mips/pci/ops-bcm63xx.c:474:6: warning: this statement may fall through [-Wimplicit-fallthrough=] if (PCI_SLOT(devfn)== 0)
^arch/mips/pci/ops-bcm63xx.c:477:2: note: here
default:
^~~~~~~
Quoted 1 line
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied to mips-fixes.
Thanks,
Paul
[ This message was auto-generated; if you believe anything is incorrect
then please email [email protected] to report it. ]