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>
This commit is contained in:
Yang Li 2021-12-21 09:14:55 +08:00 committed by David S. Miller
parent f7a5319b44
commit c48c94b0ab
1 changed files with 3 additions and 3 deletions

View File

@ -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);