net/mlx4: Mark expected switch fall-through
Subsystems (4)
PATCH 1/1 net/mlx4: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/mellanox/mlx4/eq.c: In function ‘mlx4_eq_int’:drivers/net/ethernet/mellanox/mlx4/mlx4.h:219:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (mlx4_debug_level) \
^
drivers/net/ethernet/mellanox/mlx4/eq.c:558:4: note: in expansion of macro ‘mlx4_dbg’
mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n",
^~~~~~~~drivers/net/ethernet/mellanox/mlx4/eq.c:561:3: note: here
case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR:
^~~~
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough.
--- drivers/net/ethernet/mellanox/mlx4/eq.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/mellanox/mlx4/eq.c +1 -0
@@ -558,6 +558,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)mlx4_dbg (dev,"%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n" , __func__,be32_to_cpu (eqe->event.srq.srqn), eq->eqn); +/* fall through */ case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR :if (mlx4_is_master (dev)) {/* forward only to slave owning the SRQ */
Signature · 1 line
2.20.1
Quoted 32 lines · Gustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/mellanox/mlx4/eq.c: In function ‘mlx4_eq_int’:drivers/net/ethernet/mellanox/mlx4/mlx4.h:219:5: warning: this statement may fall through [-Wimplicit-fallthrough=]if (mlx4_debug_level) \ ^ drivers/net/ethernet/mellanox/mlx4/eq.c:558:4: note: in expansion of macro ‘mlx4_dbg’ mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n", ^~~~~~~~ drivers/net/ethernet/mellanox/mlx4/eq.c:561:3: note: here case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR: ^~~~Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/net/ethernet/mellanox/mlx4/eq.c | 1 + 1 file changed, 1 insertion(+)drivers/net/ethernet/mellanox/mlx4/eq.c +0
-0
drivers/net/ethernet/mellanox/mlx4/eq.c static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) · line 564
Quoted 7 lines
drivers/net/ethernet/mellanox/mlx4/eq.c +1
-0@@ -558,6 +558,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)mlx4_dbg (dev,"%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n" , __func__,be32_to_cpu (eqe->event.srq.srqn), eq->eqn); +/* fall through */ case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR :if (mlx4_is_master (dev)) {/* forward only to slave owning the SRQ */
Thanks for your patch.
From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 23 Jan 2019 02:05:11 -0600
Quoted 16 lines
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/mellanox/mlx4/eq.c: In function ‘mlx4_eq_int’:drivers/net/ethernet/mellanox/mlx4/mlx4.h:219:5: warning: this statement may fall through [-Wimplicit-fallthrough=]if (mlx4_debug_level) \ ^ drivers/net/ethernet/mellanox/mlx4/eq.c:558:4: note: in expansion of macro ‘mlx4_dbg’ mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n", ^~~~~~~~ drivers/net/ethernet/mellanox/mlx4/eq.c:561:3: note: here case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR: ^~~~
Quoted 6 lines
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>
Applied.
Quoted 19 lines · David Miller
From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 23 Jan 2019 02:05:11 -0600Quoted 16 lines
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.
This patch fixes the following warning:
drivers/net/ethernet/mellanox/mlx4/eq.c: In function ‘mlx4_eq_int’:drivers/net/ethernet/mellanox/mlx4/mlx4.h:219:5: warning: this statement may fall through [-Wimplicit-fallthrough=]if (mlx4_debug_level) \ ^ drivers/net/ethernet/mellanox/mlx4/eq.c:558:4: note: in expansion of macro ‘mlx4_dbg’ mlx4_dbg(dev, "%s: MLX4_EVENT_TYPE_SRQ_LIMIT. srq_no=0x%x, eq 0x%x\n", ^~~~~~~~ drivers/net/ethernet/mellanox/mlx4/eq.c:561:3: note: here case MLX4_EVENT_TYPE_SRQ_CATAS_ERROR: ^~~~
Quoted 9 lines
Quoted 6 lines
Warning level 3 was used: -Wimplicit-fallthrough=3
This patch is part of the ongoing efforts to enabling -Wimplicit-fallthrough.
Signed-off-by Gustavo A. R. Silva <[email protected]>Applied.
Thank you both, Tariq and David.
--
Gustavo