• Nick Desaulniers's avatar
    netfilter: nf_nat_h323: fix logical-not-parentheses warning · eee6ebba
    Nick Desaulniers authored
    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: default avatarNick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
    eee6ebba
nf_nat_h323.c 18.3 KB