Skip to content

Commit

Permalink
IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce
Browse files Browse the repository at this point in the history
Fix static checker warning:
        drivers/infiniband/hw/mlx5/main.c:149 mlx5_query_port_roce()
        warn: passing casted pointer '&props->qkey_viol_cntr' to
	'mlx5_query_nic_vport_qkey_viol_cntr()' 32 vs 16.

Fixes: 3f89a64 ("IB/mlx5: Extend query_device/port to support RoCE")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
rleon authored and dledford committed Jan 19, 2016
1 parent d53e11f commit c876a1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/infiniband/hw/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
struct mlx5_ib_dev *dev = to_mdev(device);
struct net_device *ndev;
enum ib_mtu ndev_ib_mtu;
u16 qkey_viol_cntr;

memset(props, 0, sizeof(*props));

Expand All @@ -146,8 +147,8 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
props->state = IB_PORT_DOWN;
props->phys_state = 3;

mlx5_query_nic_vport_qkey_viol_cntr(dev->mdev,
(u16 *)&props->qkey_viol_cntr);
mlx5_query_nic_vport_qkey_viol_cntr(dev->mdev, &qkey_viol_cntr);
props->qkey_viol_cntr = qkey_viol_cntr;

ndev = mlx5_ib_get_netdev(device, port_num);
if (!ndev)
Expand Down

0 comments on commit c876a1b

Please sign in to comment.