From: Yuval Shaia Date: Sat, 13 Dec 2014 18:18:40 +0000 (-0800) Subject: mlx4_core: Check for DPDP violation only when DPDP is not supported X-Git-Tag: v4.14-rc1~6247^2^5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b9976577c47cea96933c2e0bc6e90976ff225c4;p=platform%2Fkernel%2Flinux-rpi.git mlx4_core: Check for DPDP violation only when DPDP is not supported Move check for DPDP out of the loop to make the code more readable. Signed-off-by: Yuval Shaia Signed-off-by: Roland Dreier --- diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index e25436b..629f9f1 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -171,9 +171,9 @@ int mlx4_check_port_params(struct mlx4_dev *dev, { int i; - for (i = 0; i < dev->caps.num_ports - 1; i++) { - if (port_type[i] != port_type[i + 1]) { - if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { + if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { + for (i = 0; i < dev->caps.num_ports - 1; i++) { + if (port_type[i] != port_type[i + 1]) { mlx4_err(dev, "Only same port types supported on this HCA, aborting\n"); return -EINVAL; }