提交 c48c94b0 编写于 作者: Y Yang Li 提交者: David S. Miller

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: NAbaci Robot <abaci@linux.alibaba.com>
Signed-off-by: NYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f7a5319b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册