]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: dsa: microchip: mark expected switch fall-through
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 1 Apr 2019 20:34:49 +0000 (15:34 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 4 Apr 2019 04:38:29 +0000 (21:38 -0700)
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

This patch fixes the following warning:

drivers/net/dsa/microchip/ksz9477.c: In function ‘ksz9477_get_interface’:
drivers/net/dsa/microchip/ksz9477.c:1145:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (gbit)
      ^
drivers/net/dsa/microchip/ksz9477.c:1147:2: note: here
  case 0:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz9477.c

index f16e1d7d8615d6191a42d158bf274a4e663e94d0..c026d15721f66bf3d03403b1f31d5362ec38bd9c 100644 (file)
@@ -1144,6 +1144,7 @@ static phy_interface_t ksz9477_get_interface(struct ksz_device *dev, int port)
                interface = PHY_INTERFACE_MODE_GMII;
                if (gbit)
                        break;
+               /* fall through */
        case 0:
                interface = PHY_INTERFACE_MODE_MII;
                break;