Skip to content

Commit

Permalink
mlx5: Initialize variables to avoid compilation warnings
Browse files Browse the repository at this point in the history
Some variables cause compilation warnings, as the compiler doesn't
recognize their initialization. Explicitly initialize them to avoid the
warnings.

Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Reviewed-by: Avihai Horon <avihaih@nvidia.com>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
  • Loading branch information
aharonl-nvidia authored and Yishai Hadas committed Mar 31, 2022
1 parent bac4d9b commit ee7b8e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions providers/mlx5/dr_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ struct mlx5dv_dr_action *
mlx5dv_dr_action_create_flow_meter(struct mlx5dv_dr_flow_meter_attr *attr)
{
struct mlx5dv_dr_domain *dmn = attr->next_table->dmn;
uint64_t rx_icm_addr, tx_icm_addr;
uint64_t rx_icm_addr = 0, tx_icm_addr = 0;
struct mlx5dv_devx_obj *devx_obj;
struct mlx5dv_dr_action *action;
int ret;
Expand Down Expand Up @@ -2410,7 +2410,7 @@ dr_action_create_sampler(struct mlx5dv_dr_domain *dmn,
{
struct dr_devx_flow_sampler_attr sampler_attr = {};
struct dr_flow_sampler *sampler;
uint64_t icm_rx, icm_tx;
uint64_t icm_rx = 0, icm_tx = 0;
int ret;

sampler = calloc(1, sizeof(struct dr_flow_sampler));
Expand Down
4 changes: 2 additions & 2 deletions providers/mlx5/dr_devx.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ int dr_devx_query_device(struct ibv_context *ctx, struct dr_devx_caps *caps)
{
uint32_t out[DEVX_ST_SZ_DW(query_hca_cap_out)] = {};
uint32_t in[DEVX_ST_SZ_DW(query_hca_cap_in)] = {};
bool host_pf_vhca_id_valid;
uint16_t host_pf_vhca_id;
bool host_pf_vhca_id_valid = false;
uint16_t host_pf_vhca_id = 0;
uint32_t max_sfs = 0;
bool roce, sf_supp;
int err;
Expand Down
2 changes: 1 addition & 1 deletion providers/mlx5/mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ static bool lag_operation_supported(struct ibv_qp *qp)
static int _mlx5dv_query_qp_lag_port(struct ibv_qp *qp, uint8_t *port_num,
uint8_t *active_port_num)
{
uint8_t lag_state, tx_remap_affinity_1, tx_remap_affinity_2;
uint8_t lag_state = 0, tx_remap_affinity_1 = 0, tx_remap_affinity_2 = 0;
uint32_t in_tis[DEVX_ST_SZ_DW(query_tis_in)] = {};
uint32_t out_tis[DEVX_ST_SZ_DW(query_tis_out)] = {};
uint32_t in_qp[DEVX_ST_SZ_DW(query_qp_in)] = {};
Expand Down

0 comments on commit ee7b8e7

Please sign in to comment.