net: hns: Fix for __udivdi3 compiler error
authorLin Yun Sheng <linyunsheng@huawei.com>
Fri, 4 Aug 2017 09:24:59 +0000 (17:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Aug 2017 18:06:59 +0000 (11:06 -0700)
This patch fixes the __udivdi3 undefined error reported by
test robot.

Fixes: b8c17f708831 ("net: hns: Add self-adaptive interrupt coalesce support in hns driver")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_enet.c

index 832f27792e3f9f7c99e392f8f5a73436b8bd42df..36520634c96ae127aea4c2994bd6c86ff42e3376 100644 (file)
@@ -847,7 +847,8 @@ static void hns_update_rx_rate(struct hnae_ring *ring)
 
        total_bytes = ring->stats.rx_bytes - ring->coal_last_rx_bytes;
        time_passed_ms = jiffies_to_msecs(jiffies - ring->coal_last_jiffies);
-       ring->coal_rx_rate = (total_bytes / time_passed_ms) >> 10;
+       do_div(total_bytes, time_passed_ms);
+       ring->coal_rx_rate = total_bytes >> 10;
 
        ring->coal_last_rx_bytes = ring->stats.rx_bytes;
        ring->coal_last_jiffies = jiffies;