diff options
author | Yang Li <yang.lee@linux.alibaba.com> | 2021-12-21 02:14:55 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-12-21 11:16:47 +0100 |
commit | c48c94b0ab75ef3bbfa539e6e212184e315fd5bd (patch) | |
tree | 523555363e7224ea25eceecada36a86c52de1e7d /net/sched | |
parent | Merge branch 'net-amd-xgbe-add-support-for-yellow-carp-ethernet-device' (diff) | |
download | linux-c48c94b0ab75ef3bbfa539e6e212184e315fd5bd.tar.xz linux-c48c94b0ab75ef3bbfa539e6e212184e315fd5bd.zip |
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')
-rw-r--r-- | net/sched/cls_api.c | 6 |
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); |