mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
amd-xgbe: Mark expected switch fall-throughs
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warnings: In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129: drivers/net/ethernet/amd/xgbe/xgbe-drv.c: In function ‘xgbe_set_hwtstamp_settings’: drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=] (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’ SET_BITS((_var), \ ^~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1614:3: note: in expansion of macro ‘XGMAC_SET_BITS’ XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1); ^~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1616:2: note: here case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: ^~~~ In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129: drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=] (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’ SET_BITS((_var), \ ^~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1625:3: note: in expansion of macro ‘XGMAC_SET_BITS’ XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1); ^~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1627:2: note: here case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: ^~~~ In file included from drivers/net/ethernet/amd/xgbe/xgbe-drv.c:129: drivers/net/ethernet/amd/xgbe/xgbe-common.h:1392:9: warning: this statement may fall through [-Wimplicit-fallthrough=] (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-common.h:1419:2: note: in expansion of macro ‘SET_BITS’ SET_BITS((_var), \ ^~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1636:3: note: in expansion of macro ‘XGMAC_SET_BITS’ XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1); ^~~~~~~~~~~~~~ drivers/net/ethernet/amd/xgbe/xgbe-drv.c:1638:2: note: here case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: ^~~~ Warning level 3 was used: -Wimplicit-fallthrough=3 Notice that, in this particular case, the code comments are modified in accordance with what GCC is expecting to find. 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>
This commit is contained in:
parent
60747828ea
commit
a36de5b775
@ -1612,7 +1612,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
|
||||
/* PTP v2, UDP, any kind of event packet */
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
|
||||
/* PTP v1, UDP, any kind of event packet */
|
||||
/* Fall through - to PTP v1, UDP, any kind of event packet */
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV4ENA, 1);
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV6ENA, 1);
|
||||
@ -1623,7 +1623,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
|
||||
/* PTP v2, UDP, Sync packet */
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
|
||||
/* PTP v1, UDP, Sync packet */
|
||||
/* Fall through - to PTP v1, UDP, Sync packet */
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV4ENA, 1);
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV6ENA, 1);
|
||||
@ -1634,7 +1634,7 @@ static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
|
||||
/* PTP v2, UDP, Delay_req packet */
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSVER2ENA, 1);
|
||||
/* PTP v1, UDP, Delay_req packet */
|
||||
/* Fall through - to PTP v1, UDP, Delay_req packet */
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV4ENA, 1);
|
||||
XGMAC_SET_BITS(mac_tscr, MAC_TSCR, TSIPV6ENA, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user