diff options
author | Yuval Shaia <yuval.shaia@oracle.com> | 2014-12-13 10:18:40 -0800 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-12-15 18:12:29 -0800 |
commit | 0b9976577c47cea96933c2e0bc6e90976ff225c4 (patch) | |
tree | e175edb51e06cb2643ed2612af6d3c5ae34abe2c /drivers/net | |
parent | 9f35e8995b4d6710afeeddd73f501dcd7abf2e89 (diff) | |
download | linux-stable-0b9976577c47cea96933c2e0bc6e90976ff225c4.tar.gz linux-stable-0b9976577c47cea96933c2e0bc6e90976ff225c4.tar.bz2 linux-stable-0b9976577c47cea96933c2e0bc6e90976ff225c4.zip |
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 <yuval.shaia@oracle.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index e25436b24ce7..629f9f1435a5 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; } |