netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] mlx4_core cleanups
@ 2018-12-02 15:40 Tariq Toukan
  2018-12-02 15:40 ` [PATCH net-next 1/2] net/mlx4_core: Fix return codes of unsupported operations Tariq Toukan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tariq Toukan @ 2018-12-02 15:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Tariq Toukan

Hi Dave,

This patchset by Erez contains cleanups to the mlx4_core driver.

Patch 1 replaces -EINVAL with -EOPNOTSUPP for unsupported operations.
Patch 2 fixes some coding style issues.

Series generated against net-next commit:
97e6c858a26e net: usb: aqc111: Initialize wol_cfg with memset in aqc111_suspend

Thanks,
Tariq.


Erez Alfasi (2):
  net/mlx4_core: Fix return codes of unsupported operations
  net/mlx4_core: Fix several coding style errors

 drivers/net/ethernet/mellanox/mlx4/main.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] net/mlx4_core: Fix return codes of unsupported operations
  2018-12-02 15:40 [PATCH net-next 0/2] mlx4_core cleanups Tariq Toukan
@ 2018-12-02 15:40 ` Tariq Toukan
  2018-12-02 15:40 ` [PATCH net-next 2/2] net/mlx4_core: Fix several coding style errors Tariq Toukan
  2018-12-04  0:34 ` [PATCH net-next 0/2] mlx4_core cleanups David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2018-12-02 15:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Erez Alfasi, Tariq Toukan

From: Erez Alfasi <ereza@mellanox.com>

Functions __set_port_type and mlx4_check_port_params returned
-EINVAL while the proper return code is -EOPNOTSUPP as a
result of an unsupported operation. All drivers should generate
this and all users should check for it when detecting an
unsupported functionality.

Signed-off-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 6a046030e873..4afe56a6eedf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -313,7 +313,7 @@ int mlx4_check_port_params(struct mlx4_dev *dev,
 		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;
+				return -EOPNOTSUPP;
 			}
 		}
 	}
@@ -322,7 +322,7 @@ int mlx4_check_port_params(struct mlx4_dev *dev,
 		if (!(port_type[i] & dev->caps.supported_type[i+1])) {
 			mlx4_err(dev, "Requested port type for port %d is not supported on this HCA\n",
 				 i + 1);
-			return -EINVAL;
+			return -EOPNOTSUPP;
 		}
 	}
 	return 0;
@@ -1188,8 +1188,7 @@ static int __set_port_type(struct mlx4_port_info *info,
 		mlx4_err(mdev,
 			 "Requested port type for port %d is not supported on this HCA\n",
 			 info->port);
-		err = -EINVAL;
-		goto err_sup;
+		return -EOPNOTSUPP;
 	}
 
 	mlx4_stop_sense(mdev);
@@ -1211,7 +1210,7 @@ static int __set_port_type(struct mlx4_port_info *info,
 		for (i = 1; i <= mdev->caps.num_ports; i++) {
 			if (mdev->caps.possible_type[i] == MLX4_PORT_TYPE_AUTO) {
 				mdev->caps.possible_type[i] = mdev->caps.port_type[i];
-				err = -EINVAL;
+				err = -EOPNOTSUPP;
 			}
 		}
 	}
@@ -1237,7 +1236,7 @@ static int __set_port_type(struct mlx4_port_info *info,
 out:
 	mlx4_start_sense(mdev);
 	mutex_unlock(&priv->port_mutex);
-err_sup:
+
 	return err;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] net/mlx4_core: Fix several coding style errors
  2018-12-02 15:40 [PATCH net-next 0/2] mlx4_core cleanups Tariq Toukan
  2018-12-02 15:40 ` [PATCH net-next 1/2] net/mlx4_core: Fix return codes of unsupported operations Tariq Toukan
@ 2018-12-02 15:40 ` Tariq Toukan
  2018-12-04  0:34 ` [PATCH net-next 0/2] mlx4_core cleanups David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2018-12-02 15:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Eran Ben Elisha, Erez Alfasi, Tariq Toukan

From: Erez Alfasi <ereza@mellanox.com>

Fix 3 checkpatch errors within mlx4/main.c:
- Unnecessary mlx4_debug_level global variable initialization to 0.
- Prohibited space before comma.
- Whitespaces instead of tab.


Signed-off-by: Erez Alfasi <ereza@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 4afe56a6eedf..bdb8dd161923 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -63,7 +63,7 @@
 
 #ifdef CONFIG_MLX4_DEBUG
 
-int mlx4_debug_level = 0;
+int mlx4_debug_level; /* 0 by default */
 module_param_named(debug_level, mlx4_debug_level, int, 0644);
 MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0");
 
@@ -83,7 +83,7 @@
 
 static uint8_t num_vfs[3] = {0, 0, 0};
 static int num_vfs_argc;
-module_param_array(num_vfs, byte , &num_vfs_argc, 0444);
+module_param_array(num_vfs, byte, &num_vfs_argc, 0444);
 MODULE_PARM_DESC(num_vfs, "enable #num_vfs functions if num_vfs > 0\n"
 			  "num_vfs=port1,port2,port1+2");
 
@@ -3251,7 +3251,7 @@ static u64 mlx4_enable_sriov(struct mlx4_dev *dev, struct pci_dev *pdev,
 free_mem:
 	dev->persist->num_vfs = 0;
 	kfree(dev->dev_vfs);
-        dev->dev_vfs = NULL;
+	dev->dev_vfs = NULL;
 	return dev_flags & ~MLX4_FLAG_MASTER;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] mlx4_core cleanups
  2018-12-02 15:40 [PATCH net-next 0/2] mlx4_core cleanups Tariq Toukan
  2018-12-02 15:40 ` [PATCH net-next 1/2] net/mlx4_core: Fix return codes of unsupported operations Tariq Toukan
  2018-12-02 15:40 ` [PATCH net-next 2/2] net/mlx4_core: Fix several coding style errors Tariq Toukan
@ 2018-12-04  0:34 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-12-04  0:34 UTC (permalink / raw)
  To: tariqt; +Cc: netdev, eranbe

From: Tariq Toukan <tariqt@mellanox.com>
Date: Sun,  2 Dec 2018 17:40:24 +0200

> This patchset by Erez contains cleanups to the mlx4_core driver.
> 
> Patch 1 replaces -EINVAL with -EOPNOTSUPP for unsupported operations.
> Patch 2 fixes some coding style issues.
> 
> Series generated against net-next commit:
> 97e6c858a26e net: usb: aqc111: Initialize wol_cfg with memset in aqc111_suspend

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-04  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-02 15:40 [PATCH net-next 0/2] mlx4_core cleanups Tariq Toukan
2018-12-02 15:40 ` [PATCH net-next 1/2] net/mlx4_core: Fix return codes of unsupported operations Tariq Toukan
2018-12-02 15:40 ` [PATCH net-next 2/2] net/mlx4_core: Fix several coding style errors Tariq Toukan
2018-12-04  0:34 ` [PATCH net-next 0/2] mlx4_core cleanups David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).