Skip to content

Commit

Permalink
net: openvswitch: use div_u64() for 64-by-32 divisions
Browse files Browse the repository at this point in the history
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: e573588 ("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>
  • Loading branch information
Tonghao Zhang authored and David S. Miller committed Apr 26, 2020
1 parent 4b36a0d commit 659d458
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/openvswitch/meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,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++;
Expand Down

0 comments on commit 659d458

Please sign in to comment.