]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
IB/mlx5: Use div64_u64 for num_var_hw_entries calculation
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 6 Feb 2020 14:27:54 +0000 (10:27 -0400)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 14 Feb 2020 19:21:52 +0000 (15:21 -0400)
On i386:

ERROR: "__udivdi3" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined!
ERROR: "__divdi3" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined!

Fixes: f164be8c0366 ("IB/mlx5: Extend caps stage to handle VAR capabilities")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Reported-by: Alexander Lobakin <alobakin@dlink.ru>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c

index 987bfdcd12a5b79dd8c681f947bf38f50c2e6258..e4bcfa81b70a3eedb003dceeb9634b0fbbf2bd6a 100644 (file)
@@ -6545,7 +6545,7 @@ static int mlx5_ib_init_var_table(struct mlx5_ib_dev *dev)
                                        doorbell_bar_offset);
        bar_size = (1ULL << log_doorbell_bar_size) * 4096;
        var_table->stride_size = 1ULL << log_doorbell_stride;
-       var_table->num_var_hw_entries = bar_size / var_table->stride_size;
+       var_table->num_var_hw_entries = div64_u64(bar_size, var_table->stride_size);
        mutex_init(&var_table->bitmap_lock);
        var_table->bitmap = bitmap_zalloc(var_table->num_var_hw_entries,
                                          GFP_KERNEL);