diff options
author | Jiapeng Chong <jiapeng.chong@linux.alibaba.com> | 2021-12-26 01:12:41 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2022-01-09 23:30:13 +0100 |
commit | 613a0c67d12f33dcbeec2836f5fe60d05b4c18c0 (patch) | |
tree | 8c0dba7bb42b48cec918d1db0fdf6e872939c1c9 /include/net | |
parent | 2b71e2c7b56cabe0aef95b79af98da921b87bc30 (diff) | |
download | linux-613a0c67d12f33dcbeec2836f5fe60d05b4c18c0.tar.bz2 |
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>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index 871489df63c6..a4a14f3a5e38 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h @@ -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) |