From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751647AbdBSRG0 (ORCPT ); Sun, 19 Feb 2017 12:06:26 -0500 Received: from mail-ve1eur01on0043.outbound.protection.outlook.com ([104.47.1.43]:36096 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750844AbdBSRGY (ORCPT ); Sun, 19 Feb 2017 12:06:24 -0500 From: Majd Dibbiny To: SF Markus Elfring CC: "linux-rdma@vger.kernel.org" , Doug Ledford , Hal Rosenstock , "Leon Romanovsky" , Matan Barak , "Sean Hefty" , Yishai Hadas , LKML , "kernel-janitors@vger.kernel.org" Subject: Re: [PATCH 02/29] IB/mlx4: Improve another size determination in mlx4_ib_alloc_pv_bufs() Thread-Topic: [PATCH 02/29] IB/mlx4: Improve another size determination in mlx4_ib_alloc_pv_bufs() Thread-Index: AQHSiiiPp4B5hEKHJ0ecdDPDz44DzKFwkKjq Date: Sun, 19 Feb 2017 17:06:19 +0000 Message-ID: <8E9E49BD-6A4E-4F89-9111-1711C50E790C@mellanox.com> References: <1935365a-bd7c-461e-6a84-0c5d3a501fff@users.sourceforge.net>,<14b2089f-f52c-0b18-90d5-810abc9f9fd6@users.sourceforge.net> In-Reply-To: <14b2089f-f52c-0b18-90d5-810abc9f9fd6@users.sourceforge.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=majd@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [46.121.82.152] x-ms-office365-filtering-correlation-id: d9b72a65-7e2f-48ab-6721-08d458e99fa9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(48565401081);SRVR:VI1PR05MB1422; x-microsoft-exchange-diagnostics: 1;VI1PR05MB1422;7:4yIAfgM+1VWkXeZyi/g8hBaGno9cfTYh9cfnIyk/ArAxPucaajLhXVajkfRPBIFCReRlnmlRF6S5BVptNVe7pcAxQ75yr47FYvw8Pvz/UaIlQS5UCchVQajr8yrbljukV5cerOuYQa0XUheL8f1b4rt8gRCBjH9Yx7p7IRqLYzog4jRtfNAqFxKlPkXOSbDIRcXDPvsud7Ps72RpLC3Ot5UBJ6ywXGao1KRDaqNpCFossmjD7SAHcpNe6WcdI9PuB88Q+WnkvXC/rWEFxNIF5AJ8hM3zcT+zo1vgYxZpQH9R+DdAk74UOznDjsylrez2v6w7djl+IvqyByLzmQLuhg== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(788757137089)(42262312472803); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123558025)(20161123555025)(20161123564025)(20161123562025)(6072148);SRVR:VI1PR05MB1422;BCL:0;PCL:0;RULEID:;SRVR:VI1PR05MB1422; x-forefront-prvs: 02234DBFF6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(39450400003)(39840400002)(39410400002)(39850400002)(199003)(377454003)(189002)(24454002)(68736007)(6916009)(3660700001)(66066001)(305945005)(102836003)(81156014)(97736004)(81166006)(6506006)(83716003)(33656002)(6306002)(5660300001)(25786008)(7736002)(189998001)(99286003)(6486002)(77096006)(6512007)(3846002)(8936002)(8676002)(229853002)(82746002)(54906002)(101416001)(6116002)(105586002)(53936002)(6436002)(2950100002)(6246003)(110136004)(38730400002)(86362001)(50986999)(54356999)(2900100001)(39060400002)(92566002)(966004)(122556002)(3280700002)(36756003)(2906002)(106116001)(76176999)(4326007)(106356001)(15760500002)(104396002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR05MB1422;H:DB6PR0501MB2072.eurprd05.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2017 17:06:19.2734 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB1422 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v1JH6WSF008874 > On Feb 18, 2017, at 10:49 PM, SF Markus Elfring wrote: > > From: Markus Elfring > Date: Fri, 17 Feb 2017 20:05:38 +0100 > > Replace the specification of a data structure 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 > --- > drivers/infiniband/hw/mlx4/mad.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c > index 61bd81baeb29..858da8746d49 100644 > --- a/drivers/infiniband/hw/mlx4/mad.c > +++ b/drivers/infiniband/hw/mlx4/mad.c > @@ -1607,7 +1607,7 @@ static int mlx4_ib_alloc_pv_bufs(struct mlx4_ib_demux_pv_ctx *ctx, > return -ENOMEM; > > tun_qp->tx_ring = kcalloc(MLX4_NUM_TUNNEL_BUFS, > - sizeof (struct mlx4_ib_tun_tx_buf), > + sizeof(*tun_qp->tx_ring), > GFP_KERNEL); > if (!tun_qp->tx_ring) { > kfree(tun_qp->ring); > -- > 2.11.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Thanks, Reviewed-by: Majd Dibbiny