diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2013-12-11 21:57:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-11 22:53:26 -0500 |
commit | d55d282e6af88120ad90e93a88f70e3116dc0e3d (patch) | |
tree | a0916db83806b2ec296ada4c9c62088a9813e4e5 /net | |
parent | 975022310233fb0f0193873d79a7b8438070fa82 (diff) |
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 cc106e441a63
("net: sched: tbf: fix the calculation of max_size")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_tbf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index a44928c6ba24..887e672f9d7d 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -131,8 +131,10 @@ static u64 psched_ns_t2l(const struct psched_ratecfg *r, | |||
131 | 131 | ||
132 | do_div(len, NSEC_PER_SEC); | 132 | do_div(len, NSEC_PER_SEC); |
133 | 133 | ||
134 | if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) | 134 | if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) { |
135 | len = (len / 53) * 48; | 135 | do_div(len, 53); |
136 | len = len * 48; | ||
137 | } | ||
136 | 138 | ||
137 | if (len > r->overhead) | 139 | if (len > r->overhead) |
138 | len -= r->overhead; | 140 | len -= r->overhead; |