All of lore.kernel.org
 help / color / mirror / Atom feed
* net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
@ 2022-01-15 16:03 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-01-15 16:03 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3669 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Paul Blakey <paulb@nvidia.com>
CC: Jakub Kicinski <kuba@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a33f5c380c4bd3fa5278d690421b72052456d9fe
commit: 6f022c2ddbcefaee79502ce5386dfe351d457070 net: openvswitch: Fix ct_state nat flags for conns arriving from tc
date:   6 days ago
:::::: branch date: 10 hours ago
:::::: commit date: 6 days ago
compiler: nios2-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
       if (!post_ct_dnat)
           ^
   net/openvswitch/flow.c:862:61: note: 'post_ct_dnat' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                                                               ^
   net/openvswitch/flow.c:862:17: note: 'post_ct' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                   ^
   net/openvswitch/flow.c:916:7: note: outer condition: post_ct
     if (post_ct) {
         ^
   net/openvswitch/flow.c:920:9: note: opposite inner condition: !post_ct_dnat
       if (!post_ct_dnat)
           ^
   net/openvswitch/flow.c:922:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
       if (!post_ct_snat)
           ^
   net/openvswitch/flow.c:862:39: note: 'post_ct_snat' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                                         ^
   net/openvswitch/flow.c:862:17: note: 'post_ct' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                   ^
   net/openvswitch/flow.c:916:7: note: outer condition: post_ct
     if (post_ct) {
         ^
   net/openvswitch/flow.c:922:9: note: opposite inner condition: !post_ct_snat
       if (!post_ct_snat)
           ^

vim +/if +920 net/openvswitch/flow.c

0714812134d7dc Jesse Gross     2014-10-03  912  
9dd7f8907c3705 Jarno Rajahalme 2017-02-09  913  	err = key_extract(skb, key);
635d448a1cce4b Paul Blakey     2021-12-14  914  	if (!err) {
d29334c15d33a6 wenxu           2021-03-16  915  		ovs_ct_fill_key(skb, key, post_ct);   /* Must be after key_extract(). */
6f022c2ddbcefa Paul Blakey     2022-01-06  916  		if (post_ct) {
6f022c2ddbcefa Paul Blakey     2022-01-06  917  			if (!skb_get_nfct(skb)) {
635d448a1cce4b Paul Blakey     2021-12-14  918  				key->ct_zone = zone;
6f022c2ddbcefa Paul Blakey     2022-01-06  919  			} else {
6f022c2ddbcefa Paul Blakey     2022-01-06 @920  				if (!post_ct_dnat)
6f022c2ddbcefa Paul Blakey     2022-01-06  921  					key->ct_state &= ~OVS_CS_F_DST_NAT;
6f022c2ddbcefa Paul Blakey     2022-01-06  922  				if (!post_ct_snat)
6f022c2ddbcefa Paul Blakey     2022-01-06  923  					key->ct_state &= ~OVS_CS_F_SRC_NAT;
6f022c2ddbcefa Paul Blakey     2022-01-06  924  			}
6f022c2ddbcefa Paul Blakey     2022-01-06  925  		}
635d448a1cce4b Paul Blakey     2021-12-14  926  	}
9dd7f8907c3705 Jarno Rajahalme 2017-02-09  927  	return err;
83c8df26a3b654 Pravin B Shelar 2014-09-15  928  }
83c8df26a3b654 Pravin B Shelar 2014-09-15  929  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
@ 2022-05-07 23:07 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-05-07 23:07 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3848 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Paul Blakey <paulb@nvidia.com>
CC: Jakub Kicinski <kuba@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   30c8e80f79329617012f07b09b70114592092ea4
commit: 6f022c2ddbcefaee79502ce5386dfe351d457070 net: openvswitch: Fix ct_state nat flags for conns arriving from tc
date:   4 months ago
:::::: branch date: 5 hours ago
:::::: commit date: 4 months ago
compiler: sparc64-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 6f022c2ddbcefaee79502ce5386dfe351d457070
        cppcheck --quiet --enable=style,performance,portability --template=gcc FILE

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
       if (!post_ct_dnat)
           ^
   net/openvswitch/flow.c:862:61: note: 'post_ct_dnat' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                                                               ^
   net/openvswitch/flow.c:862:17: note: 'post_ct' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                   ^
   net/openvswitch/flow.c:916:7: note: outer condition: post_ct
     if (post_ct) {
         ^
   net/openvswitch/flow.c:920:9: note: opposite inner condition: !post_ct_dnat
       if (!post_ct_dnat)
           ^
   net/openvswitch/flow.c:922:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
       if (!post_ct_snat)
           ^
   net/openvswitch/flow.c:862:39: note: 'post_ct_snat' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                                         ^
   net/openvswitch/flow.c:862:17: note: 'post_ct' is assigned value 'false' here.
    bool post_ct = false, post_ct_snat = false, post_ct_dnat = false;
                   ^
   net/openvswitch/flow.c:916:7: note: outer condition: post_ct
     if (post_ct) {
         ^
   net/openvswitch/flow.c:922:9: note: opposite inner condition: !post_ct_snat
       if (!post_ct_snat)
           ^

vim +/if +920 net/openvswitch/flow.c

0714812134d7dc Jesse Gross     2014-10-03  912  
9dd7f8907c3705 Jarno Rajahalme 2017-02-09  913  	err = key_extract(skb, key);
635d448a1cce4b Paul Blakey     2021-12-14  914  	if (!err) {
d29334c15d33a6 wenxu           2021-03-16  915  		ovs_ct_fill_key(skb, key, post_ct);   /* Must be after key_extract(). */
6f022c2ddbcefa Paul Blakey     2022-01-06  916  		if (post_ct) {
6f022c2ddbcefa Paul Blakey     2022-01-06  917  			if (!skb_get_nfct(skb)) {
635d448a1cce4b Paul Blakey     2021-12-14  918  				key->ct_zone = zone;
6f022c2ddbcefa Paul Blakey     2022-01-06  919  			} else {
6f022c2ddbcefa Paul Blakey     2022-01-06 @920  				if (!post_ct_dnat)
6f022c2ddbcefa Paul Blakey     2022-01-06  921  					key->ct_state &= ~OVS_CS_F_DST_NAT;
6f022c2ddbcefa Paul Blakey     2022-01-06  922  				if (!post_ct_snat)
6f022c2ddbcefa Paul Blakey     2022-01-06  923  					key->ct_state &= ~OVS_CS_F_SRC_NAT;
6f022c2ddbcefa Paul Blakey     2022-01-06  924  			}
6f022c2ddbcefa Paul Blakey     2022-01-06  925  		}
635d448a1cce4b Paul Blakey     2021-12-14  926  	}
9dd7f8907c3705 Jarno Rajahalme 2017-02-09  927  	return err;
83c8df26a3b654 Pravin B Shelar 2014-09-15  928  }
83c8df26a3b654 Pravin B Shelar 2014-09-15  929  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

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

end of thread, other threads:[~2022-05-07 23:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 16:03 net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition] kernel test robot
2022-05-07 23:07 kernel test robot

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.