Skip to content

Commit 659d458

Browse files
hao022davem330
authored andcommitted
net: openvswitch: use div_u64() for 64-by-32 divisions
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>
1 parent 4b36a0d commit 659d458

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/openvswitch/meter.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static struct dp_meter *dp_meter_create(struct nlattr **a)
393393
* Start with a full bucket.
394394
*/
395395
band->bucket = (band->burst_size + band->rate) * 1000ULL;
396-
band_max_delta_t = band->bucket / band->rate;
396+
band_max_delta_t = div_u64(band->bucket, band->rate);
397397
if (band_max_delta_t > meter->max_delta_t)
398398
meter->max_delta_t = band_max_delta_t;
399399
band++;

0 commit comments

Comments
 (0)