netfilter: conntrack: Use max() instead of doing it manually

Fix following coccicheck warning:

./include/net/netfilter/nf_conntrack.h:282:16-17: WARNING opportunity
for max().

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Jiapeng Chong 2021-12-26 01:12:41 +08:00 committed by Pablo Neira Ayuso
parent 2b71e2c7b5
commit 613a0c67d1
1 changed files with 1 additions and 1 deletions

View File

@ -279,7 +279,7 @@ static inline unsigned long nf_ct_expires(const struct nf_conn *ct)
{
s32 timeout = READ_ONCE(ct->timeout) - nfct_time_stamp;
return timeout > 0 ? timeout : 0;
return max(timeout, 0);
}
static inline bool nf_ct_is_expired(const struct nf_conn *ct)