All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through
@ 2019-04-29 15:37 Gustavo A. R. Silva
  2019-04-29 16:33 ` Edward Cree
  2019-05-01 15:24 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-04-29 15:37 UTC (permalink / raw)
  To: Solarflare linux maintainers, Edward Cree, Martin Habets,
	David S. Miller
  Cc: netdev, linux-kernel, Gustavo A. R. Silva, Kees Cook

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/sfc/mcdi_port.c: In function ‘efx_mcdi_phy_decode_link’:
./include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
 # define unlikely(x) __builtin_expect(!!(x), 0)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
./include/asm-generic/bug.h:125:2: note: in expansion of macro ‘unlikely’
  unlikely(__ret_warn_on);     \
  ^~~~~~~~
drivers/net/ethernet/sfc/mcdi_port.c:344:3: note: in expansion of macro ‘WARN_ON’
   WARN_ON(1);
   ^~~~~~~
drivers/net/ethernet/sfc/mcdi_port.c:345:2: note: here
  case MC_CMD_FCNTL_OFF:
  ^~~~

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>
---
 drivers/net/ethernet/sfc/mcdi_port.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/mcdi_port.c b/drivers/net/ethernet/sfc/mcdi_port.c
index 9382bb0b4d5a..a4bbfebe3d64 100644
--- a/drivers/net/ethernet/sfc/mcdi_port.c
+++ b/drivers/net/ethernet/sfc/mcdi_port.c
@@ -342,6 +342,7 @@ static void efx_mcdi_phy_decode_link(struct efx_nic *efx,
 		break;
 	default:
 		WARN_ON(1);
+		/* Fall through */
 	case MC_CMD_FCNTL_OFF:
 		link_state->fc = 0;
 		break;
-- 
2.21.0


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

* Re: [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through
  2019-04-29 15:37 [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through Gustavo A. R. Silva
@ 2019-04-29 16:33 ` Edward Cree
  2019-05-01 15:24 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: Edward Cree @ 2019-04-29 16:33 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Solarflare linux maintainers, Martin Habets,
	David S. Miller
  Cc: netdev, linux-kernel, Kees Cook

On 29/04/2019 16:37, 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/sfc/mcdi_port.c: In function ‘efx_mcdi_phy_decode_link’:
> ./include/linux/compiler.h:77:22: warning: this statement may fall through [-Wimplicit-fallthrough=]
>  # define unlikely(x) __builtin_expect(!!(x), 0)
>                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
> ./include/asm-generic/bug.h:125:2: note: in expansion of macro ‘unlikely’
>   unlikely(__ret_warn_on);     \
>   ^~~~~~~~
> drivers/net/ethernet/sfc/mcdi_port.c:344:3: note: in expansion of macro ‘WARN_ON’
>    WARN_ON(1);
>    ^~~~~~~
> drivers/net/ethernet/sfc/mcdi_port.c:345:2: note: here
>   case MC_CMD_FCNTL_OFF:
>   ^~~~
>
> 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>
Acked-by: Edward Cree <ecree@solarflare.com>

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

* Re: [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through
  2019-04-29 15:37 [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through Gustavo A. R. Silva
  2019-04-29 16:33 ` Edward Cree
@ 2019-05-01 15:24 ` David Miller
  2019-05-01 21:21   ` Gustavo A. R. Silva
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2019-05-01 15:24 UTC (permalink / raw)
  To: gustavo; +Cc: linux-net-drivers, ecree, mhabets, netdev, linux-kernel, keescook

From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Date: Mon, 29 Apr 2019 10:37:55 -0500

> In preparation to enabling -Wimplicit-fallthrough, mark switch
> cases where we are expecting to fall through.
> 
> This patch fixes the following warning:
 ...
> 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>

Applied.

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

* Re: [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through
  2019-05-01 15:24 ` David Miller
@ 2019-05-01 21:21   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2019-05-01 21:21 UTC (permalink / raw)
  To: David Miller
  Cc: linux-net-drivers, ecree, mhabets, netdev, linux-kernel, keescook



On 5/1/19 10:24 AM, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> Date: Mon, 29 Apr 2019 10:37:55 -0500
> 
>> In preparation to enabling -Wimplicit-fallthrough, mark switch
>> cases where we are expecting to fall through.
>>
>> This patch fixes the following warning:
>  ...
>> 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>
> 
> Applied.
> 

Thanks, Dave.
--
Gustavo

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

end of thread, other threads:[~2019-05-01 21:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 15:37 [PATCH net-next] sfc: mcdi_port: Mark expected switch fall-through Gustavo A. R. Silva
2019-04-29 16:33 ` Edward Cree
2019-05-01 15:24 ` David Miller
2019-05-01 21:21   ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.