Commit 225c6c8c authored by Matan Barak's avatar Matan Barak Committed by David S. Miller

net/mlx4_core: Use correct variable type for mlx4_slave_cap

We've used an incorrect type for the loop counter and the
mlx4_QUERY_FUNC_CAP function. The current input modifier
is either a port or a boolean.
Since the number of ports is always a positive value < 255,
we should use u8 instead of an integer with casting.
Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c68dd43
...@@ -335,7 +335,7 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, ...@@ -335,7 +335,7 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
return err; return err;
} }
int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
struct mlx4_func_cap *func_cap) struct mlx4_func_cap *func_cap)
{ {
struct mlx4_cmd_mailbox *mailbox; struct mlx4_cmd_mailbox *mailbox;
......
...@@ -204,7 +204,7 @@ struct mlx4_set_ib_param { ...@@ -204,7 +204,7 @@ struct mlx4_set_ib_param {
}; };
int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap); int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap);
int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u32 gen_or_port, int mlx4_QUERY_FUNC_CAP(struct mlx4_dev *dev, u8 gen_or_port,
struct mlx4_func_cap *func_cap); struct mlx4_func_cap *func_cap);
int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave, int mlx4_QUERY_FUNC_CAP_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_vhcr *vhcr, struct mlx4_vhcr *vhcr,
......
...@@ -631,7 +631,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) ...@@ -631,7 +631,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
struct mlx4_dev_cap dev_cap; struct mlx4_dev_cap dev_cap;
struct mlx4_func_cap func_cap; struct mlx4_func_cap func_cap;
struct mlx4_init_hca_param hca_param; struct mlx4_init_hca_param hca_param;
int i; u8 i;
memset(&hca_param, 0, sizeof(hca_param)); memset(&hca_param, 0, sizeof(hca_param));
err = mlx4_QUERY_HCA(dev, &hca_param); err = mlx4_QUERY_HCA(dev, &hca_param);
...@@ -732,7 +732,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) ...@@ -732,7 +732,7 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)
} }
for (i = 1; i <= dev->caps.num_ports; ++i) { for (i = 1; i <= dev->caps.num_ports; ++i) {
err = mlx4_QUERY_FUNC_CAP(dev, (u32) i, &func_cap); err = mlx4_QUERY_FUNC_CAP(dev, i, &func_cap);
if (err) { if (err) {
mlx4_err(dev, "QUERY_FUNC_CAP port command failed for port %d, aborting (%d)\n", mlx4_err(dev, "QUERY_FUNC_CAP port command failed for port %d, aborting (%d)\n",
i, err); i, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment