net/mlx5: fix unreachable MPLS error path
authorMichael Baum <michaelba@mellanox.com>
Wed, 27 May 2020 08:37:57 +0000 (08:37 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 2 Jun 2020 14:06:24 +0000 (16:06 +0200)
commit01de93f2451730d480db8db18921e1bca7cb1f3e
treeea749281991a71e5c02b17374e453e9b86e0fb31
parentc55ec83b5822af0a1be9ad016714b8adc68b1a51
net/mlx5: fix unreachable MPLS error path

The mlx5_flow_validate_item_mpls function checks MPLS item validation.
It first checks if the device supports MPLS, it is done using the ifdef
condition that if it fails to skip to endif and return the appropriate
error.

When MPLS is supported, the preprocessor will copy the body of the
function ending with return 0 followed by the lines that report MPLS
support.
In fact, these lines are unreachable because before them the function
returns 0 and in any case they are unnecessary.

Replace the endif by else and move endif to the end of the
function.

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5_flow.c