Skip to contentSkip to conversation

nfp: tls: Fix unreachable code issue

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Nov 17, 2020 – Nov 18, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfp: tls: Fix unreachable code issue

Fix the following unreachable code issue:

drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]

     208 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
     299 |   fallthrough;
         |   ^~~~~~~~~~~
---
 drivers/net/ethernet/netronome/nfp/crypto/tls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/netronome/nfp/crypto/tls.c +1 -1
index 76c51da5b66f..9b32ae46011c 100644
@@ -295,8 +295,8 @@ nfp_net_tls_add(struct net_device *netdev, struct sock *sk,
 			ipv6 = true;
 			break;
 		}
-#endif
 		fallthrough;
+#endif
 	case AF_INET:
 		req_sz = sizeof(struct nfp_crypto_req_add_v4);
 		ipv6 = false;
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Gustavo A. R. Silva

Fix the following unreachable code issue:

drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]

Quoted 8 lines
     208 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
     299 |   fallthrough;
         |   ^~~~~~~~~~~
maintainer Applied
#2 lore raw
Quoted 11 lines · On Tue, 17 Nov 2020 21:06:47 +0100 Simon Horman wrote:
Quoted 10 lines · Gustavo A. R. Silva

Fix the following unreachable code issue:

drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_add':
include/linux/compiler_attributes.h:208:41: warning: statement will never be executed [-Wswitch-unreachable]

     208 | # define fallthrough                    __attribute__((__fallthrough__))
         |                                         ^~~~~~~~~~~~~
   drivers/net/ethernet/netronome/nfp/crypto/tls.c:299:3: note: in expansion of macro 'fallthrough'
     299 |   fallthrough;
         |   ^~~~~~~~~~~
Quoted 4 lines
Quoted 2 lines

Applied, thanks!