From patchwork Sat Jan 9 11:06:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 7992101 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 673769F3F6 for ; Sat, 9 Jan 2016 11:06:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B09E20274 for ; Sat, 9 Jan 2016 11:06:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B746520270 for ; Sat, 9 Jan 2016 11:06:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754008AbcAILGd (ORCPT ); Sat, 9 Jan 2016 06:06:33 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36235 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753850AbcAILGc (ORCPT ); Sat, 9 Jan 2016 06:06:32 -0500 Received: by mail-wm0-f44.google.com with SMTP id l65so161414063wmf.1 for ; Sat, 09 Jan 2016 03:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leon-nu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=MD08GTCDjyIoIJB+03TzDLvHxpAbghxbdy3wnWF2qLk=; b=rqhLYa10lLEaRUzkq0hy/W16FaeSRECjfvu6EwDxqLS39Q2bGtlnrQxT96X2bB1tOG qx7G1s2X8LStbPaZppDBPoZ8B1SrXOZj1F53/KSljY4YXtYLF1nIL2ISywqQXbKMrJsf anc7GAhaqjr1vi5Q6EehqmD2tYeu+y1yyvMs9A9Ov4AeXQ1kDjoQ8CPJJv1pkHVamj75 fnEAoFbzwkflDOGPuGofvZaet7rg+e0KswKVijAKQaJsql/zRPOScqnqVRLqecXEufPO vBLrZSdghxkszZuABUyLU0yAce1uPSLp3/fMMsr39ovE+GuK+8lT9HK7S99F5BGYLokP hZgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MD08GTCDjyIoIJB+03TzDLvHxpAbghxbdy3wnWF2qLk=; b=cLZ88uVTEk/KNX5LwaH/fH6NxWyDE+6VuDAl4kv6kUf9OrU1d5o+FmN0H0eJYoy5Cl xNxhHpnSiYrOtRy+Fkh/mbaZmRdpdHZNeTTYDGS/TVlN1HStOGLzQ1DnkPlUkxt/ajvE ZWfswcV+1SW4TGWY0EAoTINFKJ5yXa+TdmpcqZH1lpMr3uqXtiJobWxAkCI9nQurl/r2 +1HD8IwDmyuNFKmwwxaHU1cSSFIFn4fOlpYImu0Gf8jJyeVHhN2/sNh9GQQDCGJyDt2l Lbbrlx8I13NKoZkzau1uXySVtQDN6J6iDofUADJ00NYIcp8HPzhvrdwiznuOx/PJfwPu cFVQ== X-Gm-Message-State: ALoCoQlhAsT0sSHgciNrna6ZlFJR79rlRMc1tJooKbrMmFXoy/oh6gT1zc5ti+Mv3reGfdavpbM672ra+GKTGYBFfCutW7beRg== X-Received: by 10.28.215.136 with SMTP id o130mr3550888wmg.33.1452337591083; Sat, 09 Jan 2016 03:06:31 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id u191sm673214wmd.4.2016.01.09.03.06.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jan 2016 03:06:30 -0800 (PST) From: Leon Romanovsky To: dledford@redhat.com, matanb@mellanox.com, achiad@mellanox.com, dan.carpenter@oracle.com Cc: linux-rdma@vger.kernel.org, Leon Romanovsky , Leon Romanovsky Subject: [PATCH] IB/mlx5: Fix passing casted pointer in mlx5_query_port_roce Date: Sat, 9 Jan 2016 13:06:25 +0200 Message-Id: <1452337585-13857-1-git-send-email-leon@leon.nu> X-Mailer: git-send-email 2.1.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Leon Romanovsky Reviewed-by: Sagi Grimberg --- 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)