From patchwork Fri Apr 7 21:01:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9670413 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 898EB602B3 for ; Fri, 7 Apr 2017 21:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7ABE928652 for ; Fri, 7 Apr 2017 21:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D29A28665; Fri, 7 Apr 2017 21:02:48 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable 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 0245D28652 for ; Fri, 7 Apr 2017 21:02:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754978AbdDGVC3 (ORCPT ); Fri, 7 Apr 2017 17:02:29 -0400 Received: from mout.web.de ([212.227.17.11]:59277 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbdDGVC2 (ORCPT ); Fri, 7 Apr 2017 17:02:28 -0400 Received: from [192.168.1.2] ([77.181.117.94]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MFL6u-1cr2ac46Y0-00ELRe; Fri, 07 Apr 2017 23:02:03 +0200 Subject: [PATCH 3/9] IB/IPoIB: Enclose six expressions for the sizeof operator by parentheses From: SF Markus Elfring To: linux-rdma@vger.kernel.org, target-devel@vger.kernel.org, David Ahern , Doug Ledford , Erez Shitrit , Feras Daoud , Hal Rosenstock , Leon Romanovsky , Mark Bloch , Or Gerlitz , Paolo Abeni , Roi Dayan , Sagi Grimberg , Sean Hefty , Yuval Shaia , Zhu Yanjun Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Fri, 7 Apr 2017 23:01:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:mIEgBBwR0gRh/NPCMwRrt5foOvSjNNHZtG0zKMUS26ZcC7uUA6Y j3mo9kAcQayNAoPxEgyiYOUiMn/DYSRI96paF21e0XMJE1LP2iwcR/oMRAQS68nbW2iIl5D ILsFzDbJ/O/l5uMAtOOuVbhniqkz2ATDkUukdkv4omHsuwjUQPGQiABuMYMQnrXlLNAQOX0 ipYR6093kySzTAUSk8fMQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:A1NipFmdi8k=:9vuAuiU91yzRQL51EHy4tZ rgSJXBIOCwQ/0NO3pK+28vLp86WbY4wk+TZ9QpRN/Xbb90KFfaTQgbFe+mIeuejc8mJRARdkt RcbK6JYtDrsDglHoxMClPVZpjNqSCiDtYeAq8RirjI3SIYpVCsRYxz0BaORxPjTzXbmHzuUyB VPyXgpYOSiPwQhd32IO3nX4UMXIk3OnemWddvWpTHunsgAgTaLmIHdyzj/vbuZGz+hSp6/Nsd SY3YfpTzdczaLTzZsfIIhwFzBJQhkQ8LcHHUa86vHN2UbEiXVGvZ9pz+C0XwPOIzJe7ixxM8e YLZ6IkNKbckTiIrgWzGGkuZMjLY7WGltR2Ht4byBTqHUnjXvIX5GVVhBJAYQCAwVGEjutTLLy vce+B3wMhD3jL1ElOdjO6EyRGhSLy7oWdJuJSCNU9Gko4ICFNQHbygANYzq4k86eL0eGVxmaq 0/Fat2Wn9pBgcr/rx9e5puYIHwuBUzfrgLCV9OOSYZPkBo+QGYOgxni+jpS1XiRSxWqYDCffl NEzGYkV6HSQAoqYOUbA+MxycOXY3jZwcVyo/fCoEA3IbqVZwsW1JxnmSqhQ+/XrOpIIQ+VsMw Bp3/FkrroFlGWOrbBWFWs9Ta5eb6cZaAtTuYwDv98B2RARRc7v279eJ9feReC4uIplzqvG98y JC7Wt+K09adycGJCBgfgQM9BwaWPsfNeUp4/pbi9gkMHIH2jxy+miXjLYpSB9kk9dSQ8l323h Qx/5VG7aJqlRMp7JV8J7xHsbb8ZV/8mlWlYdNdgkq+FMeJNpuT1AtMg8gNTGyW7NmR4PUieGy B3QHU5Q 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 From: Markus Elfring Date: Fri, 7 Apr 2017 19:54:15 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. WARNING: sizeof *… should be sizeof(*…) Thus fix the affected source code places. Signed-off-by: Markus Elfring Reviewed-by: Sagi Grimberg --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index c5024c6d38e7..446af4ec3d86 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -581,7 +581,7 @@ struct ipoib_path_iter *ipoib_path_iter_init(struct net_device *dev) { struct ipoib_path_iter *iter; - iter = kmalloc(sizeof *iter, GFP_KERNEL); + iter = kmalloc(sizeof(*iter), GFP_KERNEL); if (!iter) return NULL; @@ -864,7 +864,7 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, void *gid) if (!priv->broadcast) return NULL; - path = kzalloc(sizeof *path, GFP_ATOMIC); + path = kzalloc(sizeof(*path), GFP_ATOMIC); if (!path) return NULL; @@ -1161,7 +1161,7 @@ static int ipoib_hard_header(struct sk_buff *skb, { struct ipoib_header *header; - header = (struct ipoib_header *) skb_push(skb, sizeof *header); + header = (struct ipoib_header *)skb_push(skb, sizeof(*header)); header->proto = htons(type); header->reserved = 0; @@ -1329,7 +1329,7 @@ static struct ipoib_neigh *ipoib_neigh_ctor(u8 *daddr, { struct ipoib_neigh *neigh; - neigh = kzalloc(sizeof *neigh, GFP_ATOMIC); + neigh = kzalloc(sizeof(*neigh), GFP_ATOMIC); if (!neigh) return NULL; @@ -1633,7 +1633,7 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port) if (!priv->rx_ring) goto out; - priv->tx_ring = vzalloc(ipoib_sendq_size * sizeof *priv->tx_ring); + priv->tx_ring = vzalloc(ipoib_sendq_size * sizeof(*priv->tx_ring)); if (!priv->tx_ring) goto out_rx_ring_cleanup; @@ -2132,7 +2132,7 @@ static void ipoib_add_one(struct ib_device *device) int p; int count = 0; - dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL); + dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL); if (!dev_list) return;