From patchwork Sat Apr 8 12:12:38 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: 9671035 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 2A76660365 for ; Sat, 8 Apr 2017 12:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18DDF2823E for ; Sat, 8 Apr 2017 12:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AE20285E8; Sat, 8 Apr 2017 12:12:57 +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 7A2492823E for ; Sat, 8 Apr 2017 12:12:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446AbdDHMMy (ORCPT ); Sat, 8 Apr 2017 08:12:54 -0400 Received: from mout.web.de ([212.227.15.4]:58418 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752410AbdDHMMx (ORCPT ); Sat, 8 Apr 2017 08:12:53 -0400 Received: from [192.168.1.2] ([77.181.115.245]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MFvnC-1cu5vi2z9a-00EutS; Sat, 08 Apr 2017 14:12:40 +0200 Subject: [PATCH 2/3] IB/srp: Enclose 14 expressions for the sizeof operator by parentheses From: SF Markus Elfring To: linux-rdma@vger.kernel.org, Bart Van Assche , Doug Ledford , Hal Rosenstock , Sean Hefty Cc: LKML , kernel-janitors@vger.kernel.org References: <50db1f1d-b689-1a9d-f6dd-a0f55169c75a@users.sourceforge.net> Message-ID: Date: Sat, 8 Apr 2017 14:12:38 +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: <50db1f1d-b689-1a9d-f6dd-a0f55169c75a@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:xvAf0aL+4mEqnhhdC3mi33e4wcwo7e0Y5gdCvHZgWb8xwNAgjey KjUDoNn2abZxNXnIN1GGshntxUJOvonHSBlqSC+Lm/FZE57QFyCGjrOONIqgYqroZpsmfz+ jTdB+WxIok0MR6szNoQa78Lq1l4Tg37zbERw/qW8CW6yRvpl2JY1Z1vsrhgas02XKvOgYf7 H3d/SxeoLyiCmmbqMzsGA== X-UI-Out-Filterresults: notjunk:1; V01:K0:nnTORtVqYe8=:eugnQQ70t7vqb62MEnwrur tFjx5k9vPcLGD/YGODLPIk7JTwTonW7Rkqe4wy+SaCWErY2hBYhxp5vpEVJZudQkBXKx2H19Z fokGm3fK/vNsLOwKz+LMfVHUWDzIBIUFfh2hy0oU8TWNEFJLwfsHcjUoxgcYZAdD6rQ99xnLz 0N89sZ3nAzfmPPooOK7W2+16+0kSrxrR6HYQqjO0752HlgSv9v0gSNlxipMm2TcBrbPia4t5v GIZfeNju5SfKvVqvbtZ3hnETOqeITJN6NUalwTRTcbORgBP37KhXKegN2DXKJBJOyBwhSiq+H TZyadHwtONXKh7Efto2tKqCOopxaVFztx6Dzj8q1EbBTKtTZ04YtDzDdzGY0zjsuz4wefH7q1 S0gOTXYP57O2XP8h7kBrFwGnHQWrO3jLnweOyuujMtH8Qq3by+sUzarlYPndSbpQ2UY0HAlkt cga/t4ISaSWPTjbys3Wb7Gi2E5XPRICvKjD5jAf/DW5FsHzDsN6oDEgPCgX0OOUgKlQ+EOlM9 DDiM5Uz9WoVnmJo0WbSZpEK5czfM/cir3xxbbHYCxoc2thFau13EPc+1I6VXy4zBWvwqWAR/P ouNmxEnpy6z9PqBk0NO0mBj6EzMS8RTxR27baxfSG6KnDW2gzUTSULse77kcKje7PsBtmZFBM DREco3HKRw6X2OjrbNozWTEtLZpM/cPpZTiQ3hjITE8g44+5cfr3wM+Q36uP/CHk6gAQLDScm dWO9csUVzhq4aiKFXCUNNQBF4vDoR18tyunJllG5s8npJwVSsGrgcc4jfDGxHZlNdeNoTRL14 lLVyWTm 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: Sat, 8 Apr 2017 13:49:53 +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 --- drivers/infiniband/ulp/srp/ib_srp.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cf8cb7206983..bc934c5f1e36 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -213,8 +213,8 @@ static int srp_target_is_topspin(struct srp_target_port *target) static const u8 cisco_oui[3] = { 0x00, 0x1b, 0x0d }; return topspin_workarounds && - (!memcmp(&target->ioc_guid, topspin_oui, sizeof topspin_oui) || - !memcmp(&target->ioc_guid, cisco_oui, sizeof cisco_oui)); + (!memcmp(&target->ioc_guid, topspin_oui, sizeof(topspin_oui)) || + !memcmp(&target->ioc_guid, cisco_oui, sizeof(cisco_oui))); } static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, @@ -223,7 +223,7 @@ static struct srp_iu *srp_alloc_iu(struct srp_host *host, size_t size, { struct srp_iu *iu; - iu = kmalloc(sizeof *iu, gfp_mask); + iu = kmalloc(sizeof(*iu), gfp_mask); if (!iu) goto out; @@ -272,7 +272,7 @@ static int srp_init_qp(struct srp_target_port *target, struct ib_qp_attr *attr; int ret; - attr = kmalloc(sizeof *attr, GFP_KERNEL); + attr = kmalloc(sizeof(*attr), GFP_KERNEL); if (!attr) return -ENOMEM; @@ -488,7 +488,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) const int m = 1 + dev->use_fast_reg * target->mr_per_cmd * 2; int ret; - init_attr = kzalloc(sizeof *init_attr, GFP_KERNEL); + init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL); if (!init_attr) return -ENOMEM; @@ -703,7 +703,7 @@ static int srp_send_req(struct srp_rdma_ch *ch, bool multich) } *req = NULL; int status; - req = kzalloc(sizeof *req, GFP_KERNEL); + req = kzalloc(sizeof(*req), GFP_KERNEL); if (!req) return -ENOMEM; @@ -713,7 +713,7 @@ static int srp_send_req(struct srp_rdma_ch *ch, bool multich) req->param.qp_num = ch->qp->qp_num; req->param.qp_type = ch->qp->qp_type; req->param.private_data = &req->priv; - req->param.private_data_len = sizeof req->priv; + req->param.private_data_len = sizeof(req->priv); req->param.flow_control = 1; get_random_bytes(&req->param.starting_psn, 4); @@ -2164,7 +2164,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) scmnd->host_scribble = (void *) req; cmd = iu->buf; - memset(cmd, 0, sizeof *cmd); + memset(cmd, 0, sizeof(*cmd)); cmd->opcode = SRP_CMD; int_to_scsilun(scmnd->device->lun, &cmd->lun); @@ -2347,7 +2347,7 @@ static void srp_cm_rep_handler(struct ib_cm_id *cm_id, } ret = -ENOMEM; - qp_attr = kmalloc(sizeof *qp_attr, GFP_KERNEL); + qp_attr = kmalloc(sizeof(*qp_attr), GFP_KERNEL); if (!qp_attr) goto error; @@ -2575,10 +2575,10 @@ static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun, return -1; } - ib_dma_sync_single_for_cpu(dev, iu->dma, sizeof *tsk_mgmt, + ib_dma_sync_single_for_cpu(dev, iu->dma, sizeof(*tsk_mgmt), DMA_TO_DEVICE); tsk_mgmt = iu->buf; - memset(tsk_mgmt, 0, sizeof *tsk_mgmt); + memset(tsk_mgmt, 0, sizeof(*tsk_mgmt)); tsk_mgmt->opcode = SRP_TSK_MGMT; int_to_scsilun(lun, &tsk_mgmt->lun); @@ -2592,7 +2592,7 @@ static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun, init_completion(&ch->tsk_mgmt_done); - ib_dma_sync_single_for_device(dev, iu->dma, sizeof *tsk_mgmt, + ib_dma_sync_single_for_device(dev, iu->dma, sizeof(*tsk_mgmt), DMA_TO_DEVICE); if (srp_post_send(ch, iu, sizeof(*tsk_mgmt))) { srp_put_tx_iu(ch, iu, SRP_IU_TSK_MGMT); @@ -3308,7 +3308,7 @@ static ssize_t srp_create_target(struct device *dev, target_host->max_channel = 0; target_host->max_id = 1; target_host->max_lun = -1LL; - target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb; + target_host->max_cmd_len = sizeof(((struct srp_cmd *)(void *)0L)->cdb); target = host_to_target(target_host); @@ -3535,7 +3535,7 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port) { struct srp_host *host; - host = kzalloc(sizeof *host, GFP_KERNEL); + host = kzalloc(sizeof(*host), GFP_KERNEL); if (!host) return NULL;