From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: net/openvswitch/flow.c:920:9: warning: Opposite inner 'if' condition leads to a dead code block. [oppositeInnerCondition]
Date: Sun, 08 May 2022 07:07:08 +0800 [thread overview]
Message-ID: <202205080702.xBHdSI4a-lkp@intel.com> (raw)
[-- 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
next reply other threads:[~2022-05-07 23:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 23:07 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202205080702.xBHdSI4a-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.