Skip to content

Commit 685eff5

Browse files
committed
IB/mlx5: Use div64_u64 for num_var_hw_entries calculation
On i386: ERROR: "__udivdi3" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined! ERROR: "__divdi3" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined! Fixes: f164be8 ("IB/mlx5: Extend caps stage to handle VAR capabilities") Reported-by: Randy Dunlap <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Reported-by: Alexander Lobakin <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 1dd0178 commit 685eff5

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/mlx5

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/mlx5/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6545,7 +6545,7 @@ static int mlx5_ib_init_var_table(struct mlx5_ib_dev *dev)
65456545
doorbell_bar_offset);
65466546
bar_size = (1ULL << log_doorbell_bar_size) * 4096;
65476547
var_table->stride_size = 1ULL << log_doorbell_stride;
6548-
var_table->num_var_hw_entries = bar_size / var_table->stride_size;
6548+
var_table->num_var_hw_entries = div64_u64(bar_size, var_table->stride_size);
65496549
mutex_init(&var_table->bitmap_lock);
65506550
var_table->bitmap = bitmap_zalloc(var_table->num_var_hw_entries,
65516551
GFP_KERNEL);

0 commit comments

Comments
 (0)