[dpdk-dev] [PATCH v1] net/mlx4: fix missing initializers for old GCC

Adrien Mazarguil adrien.mazarguil at 6wind.com
Tue Oct 24 16:44:19 CEST 2017


On Tue, Oct 24, 2017 at 03:35:33PM +0300, Moti Haimovsky wrote:
> This patch works around compilation issues seen on RHEL 7.2
> using GCC 4.8.5:
> 
>    [...] In function 'mlx4_rss_init':
>    [...]/mlx4_rxq.c:433:19: error: 'wq_num' may be used uninitialized
>         in this function [-Werror=maybe-uninitialized]
> 
> Fixes: ff3397e90080 ("net/mlx4: relax Rx queue configuration order")
> 
> Signed-off-by: Moti Haimovsky <motih at mellanox.com>
> ---
>  drivers/net/mlx4/mlx4_rxq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
> index fb28290..4c50077 100644
> --- a/drivers/net/mlx4/mlx4_rxq.c
> +++ b/drivers/net/mlx4/mlx4_rxq.c
> @@ -417,6 +417,8 @@ void mlx4_rss_detach(struct mlx4_rss *rss)
>  		if (wq) {
>  			wq_num = wq->wq_num;
>  			claim_zero(ibv_destroy_wq(wq));
> +		} else {
> +			 wq_num = 0; /* Shut up GCC 4.8 warnings. */

Wait, there's an indentation issue here, please remove unnecessary extra
space before "wq_num".

>  		}
>  		claim_zero(ibv_destroy_cq(cq));
>  		if (!wq) {
> -- 
> 1.8.3.1
> 

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list