summaryrefslogtreecommitdiff
path: root/net/openvswitch
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2020-04-25 11:39:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 13:18:12 +0200
commit765f47c425aa07edc6de4398b923260c6c35cc97 (patch)
treeb1323d12194c4dbc88f1e35a2287027b8fbb5d67 /net/openvswitch
parentcaa44b67f4d38eaf26663e620563ef0b3a1f9c3f (diff)
net: openvswitch: use div_u64() for 64-by-32 divisions
[ Upstream commit 659d4587fe7233bfdff303744b20d6f41ad04362 ] Compile the kernel for arm 32 platform, the build warning found. To fix that, should use div_u64() for divisions. | net/openvswitch/meter.c:396: undefined reference to `__udivdi3' [add more commit msg, change reported tag, and use div_u64 instead of do_div by Tonghao] Fixes: e57358873bb5d6ca ("net: openvswitch: use u64 for meter bucket") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Tested-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/meter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/openvswitch/meter.c b/net/openvswitch/meter.c
index b10734f18bbd..541eea74ef7a 100644
--- a/net/openvswitch/meter.c
+++ b/net/openvswitch/meter.c
@@ -252,7 +252,7 @@ static struct dp_meter *dp_meter_create(struct nlattr **a)
* Start with a full bucket.
*/
band->bucket = (band->burst_size + band->rate) * 1000ULL;
- band_max_delta_t = band->bucket / band->rate;
+ band_max_delta_t = div_u64(band->bucket, band->rate);
if (band_max_delta_t > meter->max_delta_t)
meter->max_delta_t = band_max_delta_t;
band++;