提交 d55d282e 编写于 作者: Y Yang Yingliang 提交者: David S. Miller

sch_tbf: use do_div() for 64-bit divide

It's doing a 64-bit divide which is not supported
on 32-bit architectures in psched_ns_t2l(). The
correct way to do this is to use do_div().

It's introduced by commit cc106e44
("net: sched: tbf: fix the calculation of max_size")
Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 97502231
...@@ -131,8 +131,10 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r, ...@@ -131,8 +131,10 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r,
do_div(len, NSEC_PER_SEC); do_div(len, NSEC_PER_SEC);
if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) {
len = (len / 53) * 48; do_div(len, 53);
len = len * 48;
}
if (len > r->overhead) if (len > r->overhead)
len -= r->overhead; len -= r->overhead;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册