Skip to contentSkip to conversation

MIPS: OCTEON: octeon-usb: Mark expected switch fall-through

PATCH In review Guenter Roeck 2 participants 2 messages Aug 5, 2019 – Aug 6, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: OCTEON: octeon-usb: Mark expected switch fall-through

Since commit a035d552a93b ("Makefile: Globally enable fall-through warning"), cavium_octeon_defconfig builds fail with

In file included from
arch/mips/cavium-octeon/octeon-usb.c:12:
arch/mips/cavium-octeon/octeon-usb.c: In function 'dwc3_octeon_clocks_start':
include/linux/device.h:1499:2: error: this statement may fall through
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/cavium-octeon/octeon-usb.c:399:3: note:
in expansion of macro 'dev_err'
dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n", ^~~~~~~
arch/mips/cavium-octeon/octeon-usb.c:401:2: note: here
case 100000000:
^~~~~~~

Mark the switch case to expect fall through.

Cc Gustavo A. R. Silva <[email protected]>
---
 arch/mips/cavium-octeon/octeon-usb.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/cavium-octeon/octeon-usb.c +1 -0
index 1f730ded5224..8a16ab37aa11 100644
@@ -398,6 +398,7 @@ static int dwc3_octeon_clocks_start(struct device *dev, u64 base)
 	default:
 		dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",
 			clock_rate);
+		/* Fall through */
 	case 100000000:
 		mpll_mul = 0x19;
 		if (ref_clk_sel < 2)
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Guenter Roeck

Since commit a035d552a93b ("Makefile: Globally enable fall-through warning"), cavium_octeon_defconfig builds fail with

In file included from
arch/mips/cavium-octeon/octeon-usb.c:12:
arch/mips/cavium-octeon/octeon-usb.c: In function 'dwc3_octeon_clocks_start':
include/linux/device.h:1499:2: error: this statement may fall through
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/cavium-octeon/octeon-usb.c:399:3: note:
in expansion of macro 'dev_err'
dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n", ^~~~~~~
arch/mips/cavium-octeon/octeon-usb.c:401:2: note: here
case 100000000:
^~~~~~~

Quoted 4 lines

Mark the switch case to expect fall through.

Cc Gustavo A. R. Silva <[email protected]>
Quoted 19 lines
---
 arch/mips/cavium-octeon/octeon-usb.c | 1 +
 1 file changed, 1 insertion(+)
arch/mips/cavium-octeon/octeon-usb.c +1 -1
index 1f730ded5224..8a16ab37aa11 100644
@@ -398,6 +398,7 @@ static int dwc3_octeon_clocks_start(struct device *dev, u64 base)
        default:
                dev_err(dev, "Invalid ref_clk %u, using 100000000 instead\n",
                        clock_rate);
+               /* Fall through */
        case 100000000:
                mpll_mul = 0x19;
                if (ref_clk_sel < 2)
--

2.7.4