Use MLX4_ATTR_CABLE_INFO instead of 0xFF60 magic value. Also, remove MLX4_ATTR_EXTENDED_PORT_INFO which should have been done in commit 8154c07fe14e ("mlx4_core: Get rid of redundant ext_port_cap flags"). Signed-off-by: Krzysztof Piotr Oledzki <ole@xxxxxx> --- drivers/net/ethernet/mellanox/mlx4/port.c | 8 ++++---- include/linux/mlx4/device.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/port.c b/drivers/net/ethernet/mellanox/mlx4/port.c index 6dbd505e7f30..1ebd459d1d21 100644 --- a/drivers/net/ethernet/mellanox/mlx4/port.c +++ b/drivers/net/ethernet/mellanox/mlx4/port.c @@ -2052,7 +2052,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id) inmad->class_version = 0x1; inmad->mgmt_class = 0x1; inmad->base_version = 0x1; - inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */ + inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO); cable_info = (struct mlx4_cable_info *)inmad->data; cable_info->dev_mem_address = 0; @@ -2071,7 +2071,7 @@ static int mlx4_get_module_id(struct mlx4_dev *dev, u8 port, u8 *module_id) ret = be16_to_cpu(outmad->status); mlx4_warn(dev, "MLX4_CMD_MAD_IFC Get Module ID attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n", - 0xFF60, port, I2C_ADDR_LOW, 0, 1, ret, + MLX4_ATTR_CABLE_INFO, port, I2C_ADDR_LOW, 0, 1, ret, cable_info_mad_err_str(ret)); ret = -ret; goto out; @@ -2170,7 +2170,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, inmad->class_version = 0x1; inmad->mgmt_class = 0x1; inmad->base_version = 0x1; - inmad->attr_id = cpu_to_be16(0xFF60); /* Module Info */ + inmad->attr_id = cpu_to_be16(MLX4_ATTR_CABLE_INFO); if (offset < I2C_PAGE_SIZE && offset + size > I2C_PAGE_SIZE) /* Cross pages reads are not allowed @@ -2195,7 +2195,7 @@ int mlx4_get_module_info(struct mlx4_dev *dev, u8 port, ret = be16_to_cpu(outmad->status); mlx4_warn(dev, "MLX4_CMD_MAD_IFC Get Module info attr(%x) port(%d) i2c_addr(%x) offset(%d) size(%d): Response Mad Status(%x) - %s\n", - 0xFF60, port, i2c_addr, offset, size, + MLX4_ATTR_CABLE_INFO, port, i2c_addr, offset, size, ret, cable_info_mad_err_str(ret)); if (i2c_addr == I2C_ADDR_HIGH && diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index a75bfb2a4438..4f2ff466b459 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -265,7 +265,7 @@ enum { }; -#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) +#define MLX4_ATTR_CABLE_INFO 0xff60 enum { MLX4_BMME_FLAG_WIN_TYPE_2B = 1 << 1, -- 2.46.0