Skip to content

Commit

Permalink
vdpa/mlx5: fix minsize build
Browse files Browse the repository at this point in the history
Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

drivers/vdpa/mlx5/mlx5_vdpa_mem.c: In function ‘mlx5_vdpa_mem_register’:
drivers/vdpa/mlx5/mlx5_vdpa_mem.c:183:24: error:
initialization of ‘uint64_t’ {aka ‘long unsigned int’} from ‘void *’
makes integer from pointer without a cast [-Werror=int-conversion]
|         uint64_t gcd = NULL;
|                        ^~~~
drivers/vdpa/mlx5/mlx5_vdpa_mem.c:244:75: error:
‘mode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                         klm_size = mode == MLX5_MKC_ACCESS_MODE_KLM ?
|                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                               KLM_SIZE_MAX_ALIGN(empty_region_sz) : gcd;
|                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Thomas Monjalon <[email protected]>
Acked-by: Matan Azrad <[email protected]>
Reviewed-by: Ruifeng Wang <[email protected]>
  • Loading branch information
tmonjalo authored and david-marchand committed Sep 15, 2021
1 parent 51d7396 commit 5dd1256
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/vdpa/mlx5/mlx5_vdpa_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ mlx5_vdpa_mem_register(struct mlx5_vdpa_priv *priv)
struct mlx5_devx_mkey_attr mkey_attr;
struct mlx5_vdpa_query_mr *entry = NULL;
struct rte_vhost_mem_region *reg = NULL;
uint8_t mode;
uint8_t mode = 0;
uint32_t entries_num = 0;
uint32_t i;
uint64_t gcd;
uint64_t gcd = 0;
uint64_t klm_size;
uint64_t mem_size;
uint64_t k;
Expand Down

0 comments on commit 5dd1256

Please sign in to comment.