From patchwork Wed Mar 8 13:24:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9611181 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 E330C6016C for ; Wed, 8 Mar 2017 14:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07E62228C9 for ; Wed, 8 Mar 2017 14:04:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0B902857E; Wed, 8 Mar 2017 14:04:29 +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 9B6ED228C9 for ; Wed, 8 Mar 2017 14:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753467AbdCHODT (ORCPT ); Wed, 8 Mar 2017 09:03:19 -0500 Received: from mout.web.de ([212.227.15.4]:61467 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752861AbdCHODR (ORCPT ); Wed, 8 Mar 2017 09:03:17 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MhOpG-1cZ2lH2FsI-00Me3j; Wed, 08 Mar 2017 14:24:01 +0100 Subject: [PATCH 21/26] IB/ocrdma: Improve another size determination in ocrdma_create_srq() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <53b2ab35-8b0c-5cdd-dbc9-d38c7cf9e580@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:24:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:uQRCwTVbLnAmQMAfgzNnF+0haIT9jUOBdBBFO/qq6IQAW25wzr3 1lMHWEOscubbMoMxTvBLqmQx/cSruSvnE/PMrnZJeYoejHf+bLU76Owol/rizxod34N6wLA 7jiotNTm+wD/N6v+9/sxr30MGTwaXi+qUe1fW4dsKvdL/uACzLqTzI/LmO6+U4A/ZCsmQVx yJxtdtixVlnHZF57YVDzw== X-UI-Out-Filterresults: notjunk:1; V01:K0:WXcbSUVpStQ=:MfVbokfqyl2OFVqjb5o3xp EYTxsm8jabUK9fDmKbEb29KoXY6MSzvcfSdxqt5SqDWqOo1S6ARn3WNtxbC2Bh3EzAF4Jfq2Q hSTrswjBviegdXU1zqNX54gYgwkrQqNJjvErXPkwp+58dylWJbgBrfY683w/FoEU2tQ2DDsGq GDfQC8O1/uL+bnYaGfNtc9BrzEZhEdxXiamXypWAaa7iNU1Wv8iPK/PnioiLsvPqEeTseNG2y Nh+PIHGYnubUtKUhgtR2oZhbOK87Oz2nXbEHvJG6VzptQsjxUSK9BD8iV8VqrtXNzWXD45Udz eNcNxnV+akgOcQFYauJaVTM2C9hde9qEJz1ynzy906WPc1QtI+STwDWP5eb0ZPWXDpkr2A4xy gX3AZBw9ucQK4dh1NOsXIoCmzckJakUfrE0Z424PY4ABM2eAO0qr4SgmYwRqkuK6rVuKMO5U0 08nW32v3B3QxbVq5jh2w88qqHbRKUnsZvTfqsHs+OWhIAc9nQDZlV8UINDKoGNjA3Zd5xtVX/ ZCyB9ANeAi8fkpMCQBjiDY26DuCW5E7SmFEg/jGXto7VdDmDRSm7SWt5NbgL8/J1fHIIQFlIG nliloRSkeUNVnqxyJfjfN8yMRDn53SZaUz0JIf2pMeb7kloDoyNvTtXBfJeY7Y4Uldr8mfwRD cUrV9Yxgho5cH/4HhoTeBld4KQDy67FQrWaBksBd33Qx1yH0kf0YxEZh0+mNp77SoxEKp4i0Z XT+Rn9p9IA+z39/6KHqvm3R/hLjCQP0Y7YmaKMVhb0UoEDKmrqzV0yzZVV0jYkRc/kiu+o+tL pTLPgLM 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: Wed, 8 Mar 2017 10:10:50 +0100 Replace the specification of a data type by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring Acked-By: Devesh Sharma Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index af8798fd35b1..bedc229be89d 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -1915,7 +1915,7 @@ struct ib_srq *ocrdma_create_srq(struct ib_pd *ibpd, if (srq->idx_bit_fields == NULL) goto arm_err; memset(srq->idx_bit_fields, 0xff, - srq->bit_fields_len * sizeof(u32)); + srq->bit_fields_len * sizeof(*srq->idx_bit_fields)); } if (init_attr->attr.srq_limit) {