net/mlx4_en: Fix type mismatch for 32-bit systems
authorSlava Shwartsman <slavash@mellanox.com>
Thu, 29 Dec 2016 16:37:12 +0000 (18:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Dec 2016 19:17:40 +0000 (14:17 -0500)
commit61b6034c6cfdcb265bb453505c3d688e7567727a
treec85c3a5f272ea394e7e507d5bd77c8a83f0186bb
parentc1d5f8ff80ea84768f5fae1ca9d1abfbb5e6bbaa
net/mlx4_en: Fix type mismatch for 32-bit systems

is_power_of_2 expects unsigned long and we pass u64 max_val_cycles,
this will be truncated on 32 bit systems, and the result is not what we
were expecting.
div_u64 expects u32 as a second argument and we pass
max_val_cycles_rounded which is u64 hence it will always be truncated.
Fix was tested on both 64 and 32 bit systems and got same results for
max_val_cycles and max_val_cycles_rounded.

Fixes: 4850cf458157 ("net/mlx4_en: Resolve dividing by zero in 32-bit system")
Signed-off-by: Slava Shwartsman <slavash@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_clock.c