net/mlx5: fix clang compilation error
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Mon, 9 Oct 2017 14:44:52 +0000 (16:44 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
commit35a010ad48cd6aba911f9c05fc7b5d3d86bf2094
tree4ad96ef7a8a291eba31dc8f880f40ce7cce3baa6
parentf5479b6848ccfcf57b8be68c10e97c98bbc094ba
net/mlx5: fix clang compilation error

drivers/net/mlx5/mlx5_rxq.c:606:6: error: comparison of constant 4
      with expression of type 'enum hash_rxq_flow_type' is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
i != (int)RTE_DIM((*priv->hash_rxqs)[0].special_flow);
~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Clang expects to have an index going upto special_flow size which is
defined by MLX5_MAX_SPECIAL_FLOWS and value is 4.  Comparing to an
unrelated enum where index my be lower cause this compilation issue.

Fixes: 36351ea34b92 ("net/mlx: fix build with icc")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_rxq.c