From: Michael Baum Date: Wed, 18 Nov 2020 17:00:07 +0000 (+0000) Subject: regex/mlx5: remove unnecessary initializations X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=97de3671de4d067ce33ee5eeee9a87b450fb522c regex/mlx5: remove unnecessary initializations The rxp_poll_csr_for_value function defines a variable named ret. It is the return value of the function, and it is updated to 0 by default later in the function. Similarly the rxp_init_rtru function also defines a variable named ret. The function assigns into it return values from functions during the function. In both functions they initialize the ret variable when defining it. however, in both cases they do not use any ret variable before assigning into them different values, so the initializations are unnecessary. Clean the aforementioned unnecessary initializations. Fixes: e3dbbf718ebc ("regex/mlx5: support configuration") Fixes: b34d816363b5 ("regex/mlx5: support rules import") Cc: stable@dpdk.org Signed-off-by: Michael Baum Acked-by: Ori Kam --- diff --git a/drivers/regex/mlx5/mlx5_rxp.c b/drivers/regex/mlx5/mlx5_rxp.c index e54d2b807e..41fbae7ad0 100644 --- a/drivers/regex/mlx5/mlx5_rxp.c +++ b/drivers/regex/mlx5/mlx5_rxp.c @@ -225,7 +225,7 @@ rxp_poll_csr_for_value(struct ibv_context *ctx, uint32_t *value, uint32_t expected_mask, uint32_t timeout_ms, uint8_t id) { unsigned int i; - int ret = 0; + int ret; ret = -EBUSY; for (i = 0; i < timeout_ms; i++) { @@ -276,7 +276,7 @@ rxp_init_rtru(struct ibv_context *ctx, uint8_t id, uint32_t init_bits) uint32_t poll_value; uint32_t expected_value; uint32_t expected_mask; - int ret = 0; + int ret; /* Read the rtru ctrl CSR. */ ret = mlx5_devx_regex_register_read(ctx, id, MLX5_RXP_RTRU_CSR_CTRL,