summaryrefslogtreecommitdiff
path: root/net/sched/cls_api.c
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2021-12-21 09:14:55 +0800
committerDavid S. Miller <davem@davemloft.net>2021-12-21 10:16:47 +0000
commitc48c94b0ab75ef3bbfa539e6e212184e315fd5bd (patch)
tree523555363e7224ea25eceecada36a86c52de1e7d /net/sched/cls_api.c
parentf7a5319b4477f7ebda28d7170c26394d1f240487 (diff)
net/sched: use min() macro instead of doing it manually
Fix following coccicheck warnings: ./net/sched/cls_api.c:3333:17-18: WARNING opportunity for min() ./net/sched/cls_api.c:3389:17-18: WARNING opportunity for min() ./net/sched/cls_api.c:3427:17-18: WARNING opportunity for min() Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r--net/sched/cls_api.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index e3e26d358c7f..563b00481866 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3330,7 +3330,7 @@ err_unlock:
up_read(&block->cb_lock);
if (take_rtnl)
rtnl_unlock();
- return ok_count < 0 ? ok_count : 0;
+ return min(ok_count, 0);
}
EXPORT_SYMBOL(tc_setup_cb_add);
@@ -3386,7 +3386,7 @@ err_unlock:
up_read(&block->cb_lock);
if (take_rtnl)
rtnl_unlock();
- return ok_count < 0 ? ok_count : 0;
+ return min(ok_count, 0);
}
EXPORT_SYMBOL(tc_setup_cb_replace);
@@ -3424,7 +3424,7 @@ retry:
up_read(&block->cb_lock);
if (take_rtnl)
rtnl_unlock();
- return ok_count < 0 ? ok_count : 0;
+ return min(ok_count, 0);
}
EXPORT_SYMBOL(tc_setup_cb_destroy);