netfilter: Remove unnecessary conversion to bool
authorKaixu Xia <kaixuxia@tencent.com>
Fri, 6 Nov 2020 08:20:13 +0000 (16:20 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 1 Dec 2020 08:45:29 +0000 (09:45 +0100)
Here we could use the '!=' expression to fix the following coccicheck
warning:

./net/netfilter/xt_nfacct.c:30:41-46: WARNING: conversion to bool not needed here

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_nfacct.c

index a97c225..7c6bf1c 100644 (file)
@@ -27,7 +27,7 @@ static bool nfacct_mt(const struct sk_buff *skb, struct xt_action_param *par)
 
        overquota = nfnl_acct_overquota(xt_net(par), info->nfacct);
 
-       return overquota == NFACCT_UNDERQUOTA ? false : true;
+       return overquota != NFACCT_UNDERQUOTA;
 }
 
 static int