From patchwork Mon Apr 17 20:56:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dasaratharaman Chandramouli X-Patchwork-Id: 9684533 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4600A60326 for ; Mon, 17 Apr 2017 20:56:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3931228354 for ; Mon, 17 Apr 2017 20:56:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29BEB28389; Mon, 17 Apr 2017 20:56:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F37D28354 for ; Mon, 17 Apr 2017 20:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757149AbdDQU4d (ORCPT ); Mon, 17 Apr 2017 16:56:33 -0400 Received: from mga05.intel.com ([192.55.52.43]:32717 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757141AbdDQU4c (ORCPT ); Mon, 17 Apr 2017 16:56:32 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 17 Apr 2017 13:56:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,216,1488873600"; d="scan'208";a="1157212861" Received: from phwtpriv01.ph.intel.com ([10.228.208.76]) by fmsmga002.fm.intel.com with ESMTP; 17 Apr 2017 13:56:31 -0700 From: Dasaratharaman Chandramouli To: Doug Ledford Cc: linux-rdma Subject: [PATCH rdma-next 1/6] IB/CM: Add braces when using sizeof Date: Mon, 17 Apr 2017 16:56:25 -0400 Message-Id: <1492462590-64866-2-git-send-email-dasaratharaman.chandramouli@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1492462590-64866-1-git-send-email-dasaratharaman.chandramouli@intel.com> References: <1492462590-64866-1-git-send-email-dasaratharaman.chandramouli@intel.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds braces around parameters to sizeof as called out by checkpatch Reviewed-by: Don Hiatt Reviewed-by: Ira Weiny Signed-off-by: Dasaratharaman Chandramouli --- drivers/infiniband/core/cm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index d35c2de..53661f34 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -1404,7 +1404,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, struct ib_sa_path_rec *primary_path, struct ib_sa_path_rec *alt_path) { - memset(primary_path, 0, sizeof *primary_path); + memset(primary_path, 0, sizeof(*primary_path)); primary_path->dgid = req_msg->primary_local_gid; primary_path->sgid = req_msg->primary_remote_gid; primary_path->dlid = req_msg->primary_local_lid; @@ -1426,7 +1426,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, primary_path->service_id = req_msg->service_id; if (req_msg->alt_local_lid) { - memset(alt_path, 0, sizeof *alt_path); + memset(alt_path, 0, sizeof(*alt_path)); alt_path->dgid = req_msg->alt_local_gid; alt_path->sgid = req_msg->alt_remote_gid; alt_path->dlid = req_msg->alt_local_lid; @@ -3712,7 +3712,7 @@ static void cm_recv_handler(struct ib_mad_agent *mad_agent, atomic_long_inc(&port->counter_group[CM_RECV]. counter[attr_id - CM_ATTR_ID_OFFSET]); - work = kmalloc(sizeof *work + sizeof(struct ib_sa_path_rec) * paths, + work = kmalloc(sizeof(*work) + sizeof(struct ib_sa_path_rec) * paths, GFP_KERNEL); if (!work) { ib_free_recv_mad(mad_recv_wc);