diff mbox series

[net-next] nfp: silence set but not used warning with IPV6=n

Message ID 20201209161821.1040796-1-kuba@kernel.org (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net-next] nfp: silence set but not used warning with IPV6=n | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Jakub Kicinski Dec. 9, 2020, 4:18 p.m. UTC
Test robot reports:

drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
  477 |  struct ipv6hdr *ipv6h;
      |                  ^~~~~
In file included from include/linux/compiler_types.h:65,
                    from <command-line>:
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;
      |   ^~~~~~~~~~~

Use the IPv6 header in the switch, it doesn't matter which header
we use to read the version field.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/ethernet/netronome/nfp/crypto/tls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Horman Dec. 9, 2020, 4:53 p.m. UTC | #1
On Wed, Dec 09, 2020 at 08:18:21AM -0800, Jakub Kicinski wrote:
> Test robot reports:
> 
> drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
>   477 |  struct ipv6hdr *ipv6h;
>       |                  ^~~~~
> In file included from include/linux/compiler_types.h:65,
>                     from <command-line>:
> 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;
>       |   ^~~~~~~~~~~
> 
> Use the IPv6 header in the switch, it doesn't matter which header
> we use to read the version field.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Thanks Jakub,

this looks good to me.

Reviewed-by: Simon Horman <simon.horman@netronome.com>
David Miller Dec. 10, 2020, 3:42 a.m. UTC | #2
From: Jakub Kicinski <kuba@kernel.org>
Date: Wed,  9 Dec 2020 08:18:21 -0800

> Test robot reports:
> 
> drivers/net/ethernet/netronome/nfp/crypto/tls.c: In function 'nfp_net_tls_rx_resync_req':
> drivers/net/ethernet/netronome/nfp/crypto/tls.c:477:18: warning: variable 'ipv6h' set but not used [-Wunused-but-set-variable]
>   477 |  struct ipv6hdr *ipv6h;
>       |                  ^~~~~
> In file included from include/linux/compiler_types.h:65,
>                     from <command-line>:
> 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;
>       |   ^~~~~~~~~~~
> 
> Use the IPv6 header in the switch, it doesn't matter which header
> we use to read the version field.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/crypto/tls.c b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
index 9b32ae46011c..84d66d138c3d 100644
--- a/drivers/net/ethernet/netronome/nfp/crypto/tls.c
+++ b/drivers/net/ethernet/netronome/nfp/crypto/tls.c
@@ -492,7 +492,7 @@  int nfp_net_tls_rx_resync_req(struct net_device *netdev,
 		goto err_cnt_ign;
 	}
 
-	switch (iph->version) {
+	switch (ipv6h->version) {
 	case 4:
 		sk = inet_lookup_established(dev_net(netdev), &tcp_hashinfo,
 					     iph->saddr, th->source, iph->daddr,