From patchwork Sat Jan 9 11:01:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 7992081 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E1381BEEE5 for ; Sat, 9 Jan 2016 11:01:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 002C720274 for ; Sat, 9 Jan 2016 11:01:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 651C420270 for ; Sat, 9 Jan 2016 11:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbcAILBk (ORCPT ); Sat, 9 Jan 2016 06:01:40 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36854 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043AbcAILBj (ORCPT ); Sat, 9 Jan 2016 06:01:39 -0500 Received: by mail-wm0-f46.google.com with SMTP id l65so161330032wmf.1 for ; Sat, 09 Jan 2016 03:01:38 -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=sHcNZULlNweEgZ2KQWd8NZMq6BoD+Ow6KFiqTYEbex8=; b=aujfBGP2+9ywyo543OSnZlr8MEoLcBGea70fkmVSzXceoi+pxJ5Lc0QpQZLPZMeT7b 3UIw/klrn0Sl7ZrqAdT6TKiFRW0TgWltwqLU+C2FN6uOVXSQaJm0nOGAoqRteN4L7LC0 ELo1i0VkhiD7bl8eA4JOe25hlWXTRNedlFK3nPZOgMLq0L9L6b2yfVoW3EqiI2sB8x8o Nqzntz1w4uUOhbLpKG8vwNC6QRw3j/alW1zsoLe3KHpIiEDWeaadtgjQGEq90CW52Au9 KG2/73dvGnkbj+ZjErX2EVhyV7jvp6Etag0tl7mvvZHnZTGhQaZcBaZPJJHO90uBWwi3 4laQ== 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=sHcNZULlNweEgZ2KQWd8NZMq6BoD+Ow6KFiqTYEbex8=; b=WvjJ4n2/9A8kzpnAWr6wq0eRwGET2lkI1ilsH6tdh6sRLIx67F0WUTnFmm3oh+qFZG 3BTkW5d7JDsSFDWTCKTra9DAwQ1D0JC2iQfrNdec/T3vAkac7SuiPunkG5p1FNm/hv1y 0AJOA6PlsgJWJkH3Ld2oE7pguqjhjtZuSeHAodqsvs22N6sYzZX0qcU4OU4aBZJrHVaT FYfN2MO9n6nuJC1F/+3uIv+n093VT2j4FL8JDDnifPCqCCSsVhOuX/Omjz8V8y4KRyo2 dTf6DYaNvJlg5l4XWurG98/bO5F97FMpYw5jS2+bF1bjs1JYB+7snPBrSkMn9bvuFLlO NcVw== X-Gm-Message-State: ALoCoQnCi0NJColRQcL9vWY7XLwxZA/h0OiiVttOXVEHZocy8JRBTVVavL0Td9wUiknqM+5WuE1qw29jq+6bJVk5J6pWTOrlew== X-Received: by 10.194.116.71 with SMTP id ju7mr22598513wjb.2.1452337298034; Sat, 09 Jan 2016 03:01:38 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id y188sm3230978wmy.11.2016.01.09.03.01.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jan 2016 03:01:37 -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:01:19 +0200 Message-Id: <1452337279-13593-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 --- 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)