linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce
@ 2016-01-09 11:01 Leon Romanovsky
       [not found] ` <1452337279-13593-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2016-01-09 11:01 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, matanb-VPRAkNaXOzVWk0Htik3J/w,
	achiad-VPRAkNaXOzVWk0Htik3J/w,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Leon Romanovsky

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: 3f89a643eb29 ("IB/mlx5: Extend query_device/port to support RoCE")
Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 5e3d3ae..890cf20 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -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));
 
@@ -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)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce
       [not found] ` <1452337279-13593-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-01-19 21:01   ` Doug Ledford
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-01-19 21:01 UTC (permalink / raw)
  To: Leon Romanovsky, matanb-VPRAkNaXOzVWk0Htik3J/w,
	achiad-VPRAkNaXOzVWk0Htik3J/w,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky

[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

On 01/09/2016 06:01 AM, Leon Romanovsky wrote:
> 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: 3f89a643eb29 ("IB/mlx5: Extend query_device/port to support RoCE")
> Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx5/main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> index 5e3d3ae..890cf20 100644
> --- a/drivers/infiniband/hw/mlx5/main.c
> +++ b/drivers/infiniband/hw/mlx5/main.c
> @@ -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));
>  
> @@ -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)
> 

Thanks, applied.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

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

* Re: [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce
       [not found] ` <1452337585-13857-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-01-10 11:47   ` Sagi Grimberg
  0 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2016-01-10 11:47 UTC (permalink / raw)
  To: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	matanb-VPRAkNaXOzVWk0Htik3J/w, achiad-VPRAkNaXOzVWk0Htik3J/w,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky

Looks fine,

Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce
@ 2016-01-09 11:06 Leon Romanovsky
       [not found] ` <1452337585-13857-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2016-01-09 11:06 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA, matanb-VPRAkNaXOzVWk0Htik3J/w,
	achiad-VPRAkNaXOzVWk0Htik3J/w,
	dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Leon Romanovsky

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: 3f89a643eb29 ("IB/mlx5: Extend query_device/port to support RoCE")
Reported-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 5e3d3ae..890cf20 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -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));
 
@@ -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)
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-01-19 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-09 11:01 [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce Leon Romanovsky
     [not found] ` <1452337279-13593-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2016-01-19 21:01   ` Doug Ledford
2016-01-09 11:06 Leon Romanovsky
     [not found] ` <1452337585-13857-1-git-send-email-leon-2ukJVAZIZ/Y@public.gmane.org>
2016-01-10 11:47   ` Sagi Grimberg

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).