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:
parent
f7a5319b44
commit
c48c94b0ab
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue