diff mbox series

MIPS: Annotate fall-throughs in Cavium Octeon code

Message ID 20190717201159.23627-1-paul.burton@mips.com (mailing list archive)
State Accepted
Commit 13d282d71aa495a46ef50565b5c66b2a2815ff29
Headers show
Series MIPS: Annotate fall-throughs in Cavium Octeon code | expand

Commit Message

Paul Burton July 17, 2019, 8:12 p.m. UTC
There are a couple of intentional switch case fall-throughs in Cavium
Octeon code, which trigger compile errors with -Wimplicit-fallthrough
due to -Werror being enabled for arch/mips.

These can be encountered when building cavium_octeon_defconfig.

Fix the build issues by annotating the intentional fall-throughs.

Signed-off-by: Paul Burton <paul.burton@mips.com>
---

 arch/mips/cavium-octeon/executive/cvmx-pko.c | 2 +-
 arch/mips/cavium-octeon/octeon-usb.c         | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Paul Burton July 18, 2019, 8:52 p.m. UTC | #1
Hello,

Paul Burton wrote:
> There are a couple of intentional switch case fall-throughs in Cavium
> Octeon code, which trigger compile errors with -Wimplicit-fallthrough
> due to -Werror being enabled for arch/mips.
> 
> These can be encountered when building cavium_octeon_defconfig.
> 
> Fix the build issues by annotating the intentional fall-throughs.
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>

Applied to mips-fixes.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/cavium-octeon/executive/cvmx-pko.c b/arch/mips/cavium-octeon/executive/cvmx-pko.c
index 676fab50dd2b..c2a97b62742b 100644
--- a/arch/mips/cavium-octeon/executive/cvmx-pko.c
+++ b/arch/mips/cavium-octeon/executive/cvmx-pko.c
@@ -485,11 +485,11 @@  cvmx_pko_status_t cvmx_pko_config_port(uint64_t port, uint64_t base_queue,
 			config.s.qos_mask = 0xff;
 			break;
 		case CVMX_PKO_QUEUE_STATIC_PRIORITY:
-			/* Pass 1 will fall through to the error case */
 			if (!cvmx_octeon_is_pass1()) {
 				config.s.qos_mask = 0xff;
 				break;
 			}
+			/* fall through - pass 1 hits the error case */
 		default:
 			cvmx_dprintf("ERROR: cvmx_pko_config_port: Invalid "
 				     "priority %llu\n",
diff --git a/arch/mips/cavium-octeon/octeon-usb.c b/arch/mips/cavium-octeon/octeon-usb.c
index 1f730ded5224..cc88a08bc1f7 100644
--- a/arch/mips/cavium-octeon/octeon-usb.c
+++ b/arch/mips/cavium-octeon/octeon-usb.c
@@ -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)