Commit fe86d714 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

mlx4_en: fix a build error on 32bit arches

commit b6c39bfc ("net/mlx4_en: Add a service task")
added a build error on 32bit arches.

ERROR: "__udivdi3" [drivers/net/ethernet/mellanox/mlx4/mlx4_en.ko]
undefined!

Fix this problem by using do_div()
Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Cc: Amir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 97cd1ee6
...@@ -114,6 +114,7 @@ void mlx4_en_fill_hwtstamps(struct mlx4_en_dev *mdev, ...@@ -114,6 +114,7 @@ void mlx4_en_fill_hwtstamps(struct mlx4_en_dev *mdev,
void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev) void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
{ {
struct mlx4_dev *dev = mdev->dev; struct mlx4_dev *dev = mdev->dev;
u64 ns;
memset(&mdev->cycles, 0, sizeof(mdev->cycles)); memset(&mdev->cycles, 0, sizeof(mdev->cycles));
mdev->cycles.read = mlx4_en_read_clock; mdev->cycles.read = mlx4_en_read_clock;
...@@ -133,10 +134,9 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev) ...@@ -133,10 +134,9 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
/* Calculate period in seconds to call the overflow watchdog - to make /* Calculate period in seconds to call the overflow watchdog - to make
* sure counter is checked at least once every wrap around. * sure counter is checked at least once every wrap around.
*/ */
mdev->overflow_period = ns = cyclecounter_cyc2ns(&mdev->cycles, mdev->cycles.mask);
(cyclecounter_cyc2ns(&mdev->cycles, do_div(ns, NSEC_PER_SEC / 2 / HZ);
mdev->cycles.mask) / NSEC_PER_SEC / 2) mdev->overflow_period = ns;
* HZ;
} }
void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev) void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment