net/mlx4: Replace ENOSYS with better fitting error codes
authorTariq Toukan <tariqt@mellanox.com>
Sun, 29 Jan 2017 16:56:13 +0000 (18:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 30 Jan 2017 20:26:41 +0000 (15:26 -0500)
Conform the following warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else.

Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
drivers/net/ethernet/mellanox/mlx4/fw.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index d5a9372ed84d3127cf16c07bc43666651fe2486d..17a600b9f81bff3d9e64d1065d8ec3908a009a24 100644 (file)
@@ -1980,7 +1980,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
                modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
                break;
        default:
-               return -ENOSYS;
+               return -EINVAL;
        }
 
        return 0;
index 84bab9f0732ea239bce5adaac7eb52d0298cc751..25b5b32e958ffbb01780e0792a97a7ecac198918 100644 (file)
@@ -672,7 +672,7 @@ int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
        MLX4_GET(field, outbox, QUERY_FUNC_CAP_PHYS_PORT_OFFSET);
        func_cap->physical_port = field;
        if (func_cap->physical_port != gen_or_port) {
-               err = -ENOSYS;
+               err = -EINVAL;
                goto out;
        }
 
index bffa6f345f2f40e35ebab8e546237da4fbe6b6a8..15ef787e71ba1072d2f9693392ae5e0269e06066 100644 (file)
@@ -838,7 +838,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
         */
        if (hca_param.global_caps) {
                mlx4_err(dev, "Unknown hca global capabilities\n");
-               return -ENOSYS;
+               return -EINVAL;
        }
 
        mlx4_log_num_mgm_entry_size = hca_param.log_mc_entry_sz;
@@ -896,7 +896,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
            PF_CONTEXT_BEHAVIOUR_MASK) {
                mlx4_err(dev, "Unknown pf context behaviour %x known flags %x\n",
                         func_cap.pf_context_behaviour, PF_CONTEXT_BEHAVIOUR_MASK);
-               return -ENOSYS;
+               return -EINVAL;
        }
 
        dev->caps.num_ports             = func_cap.num_ports;
@@ -3492,7 +3492,7 @@ slave_start:
        mlx4_enable_msi_x(dev);
        if ((mlx4_is_mfunc(dev)) &&
            !(dev->flags & MLX4_FLAG_MSI_X)) {
-               err = -ENOSYS;
+               err = -EOPNOTSUPP;
                mlx4_err(dev, "INTx is not supported in multi-function mode, aborting\n");
                goto err_free_eq;
        }
index 6da6e01d07bd83462d9db0b2ff722e65747cd4d5..84c74a79752a179c0576c9bb13e57e38d3ff746a 100644 (file)
@@ -1396,7 +1396,7 @@ static int remove_ok(struct res_common *res, enum mlx4_resource type, int extra)
        case RES_MTT:
                return remove_mtt_ok((struct res_mtt *)res, extra);
        case RES_MAC:
-               return -ENOSYS;
+               return -EOPNOTSUPP;
        case RES_EQ:
                return remove_eq_ok((struct res_eq *)res);
        case RES_COUNTER: