* [PATCH] netfilter: Remove unnecessary conversion to bool
@ 2020-11-06 8:20 xiakaixu1987
2020-12-01 8:46 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-06 8:20 UTC (permalink / raw)
To: pablo, kadlec, fw; +Cc: netfilter-devel, coreteam, linux-kernel, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
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>
---
net/netfilter/xt_nfacct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/xt_nfacct.c b/net/netfilter/xt_nfacct.c
index a97c2259bbc8..7c6bf1c16813 100644
--- a/net/netfilter/xt_nfacct.c
+++ b/net/netfilter/xt_nfacct.c
@@ -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
--
2.20.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] netfilter: Remove unnecessary conversion to bool
2020-11-06 8:20 [PATCH] netfilter: Remove unnecessary conversion to bool xiakaixu1987
@ 2020-12-01 8:46 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2020-12-01 8:46 UTC (permalink / raw)
To: xiakaixu1987
Cc: kadlec, fw, netfilter-devel, coreteam, linux-kernel, Kaixu Xia
On Fri, Nov 06, 2020 at 04:20:13PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> 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
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-01 8:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-06 8:20 [PATCH] netfilter: Remove unnecessary conversion to bool xiakaixu1987
2020-12-01 8:46 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).