aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-04-30 06:53:51 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-30 19:00:25 -0400
commitfe86d714168f1567989c309f73a3550022686301 (patch)
treee8e95e9a96b4b42e1e94971b16cac6b0eced1312 /drivers/net/ethernet/mellanox
parent97cd1ee6ef24eadf42bb199ab20bdc07cf919939 (diff)
mlx4_en: fix a build error on 32bit arches
commit b6c39bfcf1d7d63 ("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: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Cc: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_clock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_clock.c b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
index 2f181219662e..fd6441071319 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_clock.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_clock.c
@@ -114,6 +114,7 @@ void mlx4_en_fill_hwtstamps(struct mlx4_en_dev *mdev,
114void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev) 114void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
115{ 115{
116 struct mlx4_dev *dev = mdev->dev; 116 struct mlx4_dev *dev = mdev->dev;
117 u64 ns;
117 118
118 memset(&mdev->cycles, 0, sizeof(mdev->cycles)); 119 memset(&mdev->cycles, 0, sizeof(mdev->cycles));
119 mdev->cycles.read = mlx4_en_read_clock; 120 mdev->cycles.read = mlx4_en_read_clock;
@@ -133,10 +134,9 @@ void mlx4_en_init_timestamp(struct mlx4_en_dev *mdev)
133 /* Calculate period in seconds to call the overflow watchdog - to make 134 /* Calculate period in seconds to call the overflow watchdog - to make
134 * sure counter is checked at least once every wrap around. 135 * sure counter is checked at least once every wrap around.
135 */ 136 */
136 mdev->overflow_period = 137 ns = cyclecounter_cyc2ns(&mdev->cycles, mdev->cycles.mask);
137 (cyclecounter_cyc2ns(&mdev->cycles, 138 do_div(ns, NSEC_PER_SEC / 2 / HZ);
138 mdev->cycles.mask) / NSEC_PER_SEC / 2) 139 mdev->overflow_period = ns;
139 * HZ;
140} 140}
141 141
142void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev) 142void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev)