linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx4: Mark expected switch fall-through
@ 2019-01-23  8:05 Gustavo A. R. Silva
  2019-01-23 12:29 ` Tariq Toukan
  2019-01-23 17:08 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-23  8:05 UTC (permalink / raw)
  To: Tariq Toukan, David S. Miller
  Cc: netdev, linux-rdma, linux-kernel, 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 <gustavo@embeddedor.com>
---
 drivers/net/ethernet/mellanox/mlx4/eq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index 4953c852c247..2f4201023836 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -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 */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx4: Mark expected switch fall-through
  2019-01-23  8:05 [PATCH net-next] net/mlx4: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-01-23 12:29 ` Tariq Toukan
  2019-01-23 17:08 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2019-01-23 12:29 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Tariq Toukan, David S. Miller
  Cc: netdev, linux-rdma, linux-kernel



On 1/23/2019 10:05 AM, Gustavo A. R. Silva wrote:
> 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 <gustavo@embeddedor.com>
> ---
>   drivers/net/ethernet/mellanox/mlx4/eq.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
> index 4953c852c247..2f4201023836 100644
> --- a/drivers/net/ethernet/mellanox/mlx4/eq.c
> +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
> @@ -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 */
> 


Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Thanks for your patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx4: Mark expected switch fall-through
  2019-01-23  8:05 [PATCH net-next] net/mlx4: Mark expected switch fall-through Gustavo A. R. Silva
  2019-01-23 12:29 ` Tariq Toukan
@ 2019-01-23 17:08 ` David Miller
  2019-01-23 18:09   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2019-01-23 17:08 UTC (permalink / raw)
  To: gustavo; +Cc: tariqt, netdev, linux-rdma, linux-kernel

From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Wed, 23 Jan 2019 02:05:11 -0600

> 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 <gustavo@embeddedor.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net/mlx4: Mark expected switch fall-through
  2019-01-23 17:08 ` David Miller
@ 2019-01-23 18:09   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-01-23 18:09 UTC (permalink / raw)
  To: David Miller; +Cc: tariqt, netdev, linux-rdma, linux-kernel



On 1/23/19 11:08 AM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Wed, 23 Jan 2019 02:05:11 -0600
> 
>> 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 <gustavo@embeddedor.com>
> 
> Applied.
> 

Thank you both, Tariq and David.

--
Gustavo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-23 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23  8:05 [PATCH net-next] net/mlx4: Mark expected switch fall-through Gustavo A. R. Silva
2019-01-23 12:29 ` Tariq Toukan
2019-01-23 17:08 ` David Miller
2019-01-23 18:09   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).