mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
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
1 changed files with 3 additions and 3 deletions
|
@ -3330,7 +3330,7 @@ int tc_setup_cb_add(struct tcf_block *block, struct tcf_proto *tp,
|
|||
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 @@ int tc_setup_cb_replace(struct tcf_block *block, struct tcf_proto *tp,
|
|||
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 @@ int tc_setup_cb_destroy(struct tcf_block *block, struct tcf_proto *tp,
|
|||
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 a new issue