netfilter: nf_nat_h323: fix logical-not-parentheses warning
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 11 Aug 2017 18:16:07 +0000 (11:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Apr 2018 10:12:44 +0000 (12:12 +0200)
commit4d1fc27f41b24cdfa69413e1c03a50c591cbae9a
treeb6f0c1d1f5ec4c13f68c80fa4d6dd10321127303
parentb4361da43816836e2a28b266dc7ae4c12d754edb
netfilter: nf_nat_h323: fix logical-not-parentheses warning

commit eee6ebbac18a189ef33d25ea9b8bcae176515e49 upstream.

Clang produces the following warning:

net/ipv4/netfilter/nf_nat_h323.c:553:6: error:
logical not is only applied to the left hand side of this comparison
  [-Werror,-Wlogical-not-parentheses]
if (!set_h225_addr(skb, protoff, data, dataoff, taddr,
    ^
add parentheses after the '!' to evaluate the comparison first
add parentheses around left hand side expression to silence this warning

There's not necessarily a bug here, but it's cleaner to return early,
ex:

if (x)
  return
...

rather than:

if (x == 0)
  ...
else
  return

Also added a return code check that seemed to be missing in one
instance.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/netfilter/nf_nat_h323.c