From patchwork Wed Sep 21 16:47:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9343893 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 451756077A for ; Wed, 21 Sep 2016 16:47:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C3D2A6B8 for ; Wed, 21 Sep 2016 16:47:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3743D2A6E5; Wed, 21 Sep 2016 16:47:52 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 009A12A6B8 for ; Wed, 21 Sep 2016 16:47:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA14B6E870; Wed, 21 Sep 2016 16:47:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4D2F96E870 for ; Wed, 21 Sep 2016 16:47:49 +0000 (UTC) Received: from [192.168.1.2] ([77.182.212.253]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LegAQ-1bBiEY2XYE-00qSwV; Wed, 21 Sep 2016 18:47:44 +0200 Subject: [PATCH 06/14] GPU-DRM-OMAP: Improve a size determination in omap_dmm_probe() To: dri-devel@lists.freedesktop.org, David Airlie , Laurent Pinchart , Tomi Valkeinen References: <566ABCD9.1060404@users.sourceforge.net> <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> From: SF Markus Elfring Message-ID: <53794942-5588-5db7-fcff-5f6f27b2e1f4@users.sourceforge.net> Date: Wed, 21 Sep 2016 18:47:43 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <0ea38611-3d93-0ade-a1fb-f8cc2e0b8d61@users.sourceforge.net> X-Provags-ID: V03:K0:FQh0aSx2UXyapdfmkZa54YODewaix8El+FQWRPsuIBXygmZBfjX Ul4r5vvnHK9KeoUYsiI3FmmmfxnuclDAgbyQPhrtWOx3L5TGF7dByc4kUNjLYxL8MHPOKgr Zh4PmPgUweckvEIVm1fYe89fmo1fNJUGGOIphOQczWZEdH0d/tNNna3//JoFilB5kdbDIrI XA8TTfK1/0X2qpYp8v+Bg== X-UI-Out-Filterresults: notjunk:1; V01:K0:hYRj6DmLp1Q=:+Orp6GHKR7QvlF+oHdtSt0 +T5BhqlTyQSxTKIlm75SNJZWoyl632jrPiS/oy7wuwTie0NTkGDlTVvDP0DJkQOTNc1jYaKoq /ES1CacfbT32k1qo1iTbRFeA/LFojX+f9ffiRnBfB0+sQf05OL0rFeCFs9dO/8FrMQOp1b0Ve sulFv3bHQp12bnbyzkAcsMII13b7//A/Dwmg6o15nWLUdzM8SsQn2jsQNrOcw+/z6rcpvurzj wvuHnt1xw/wFqR1xWKvvSOIdnPJXIluLY2t1v9SPn8AUiHSO6co8AhOqT5VsWAavzfxDKtDJ6 m9bhaXK+6Chemr4uBMNERl4k69K6ZKYfWqtQekTzyAJZYoBlwZLgTwxmFzZ+hijwCCbJK3v89 WsyoNSGs1qyj3eTJq9BJndQSUDyyy+V7dLo03OF7JF8nHSHFBeDi5LIXEtnVDWpK0wCdjgrfT 6DvdNNY9F0cJ6Us9IpR8hq318tRMWJ2Q2oE01AwLvEP5sZBCJyRls7O3LuPiq0JBRzb+El1I2 oad63EWQERp/5LBNbsFUQ8sa7YG57XlW5fBF61yMdy1wz6sYDvz+RG5U6gCXKh7S4/UuxkCgn k5JoVjI54v/klXeu3kgVvetXpZmnWMYZJn4Up7yC2ixDRoNC5C7HlfOUi1/KmolOFF4N38vFh +8bidf7GEp9fPi+36Ou6t88wIuejoo7tYIGhhVVg1HE2c/VksOSM2oAiY7YCc8Fwg00Mo43lu rDqer4FOwuIvzV9jXG/BuNfj8raSu3E3AP6JunxWPbvkOZKlwm668gIjlPwVEj1KiyVqs3u5/ /fWcx5U Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 21 Sep 2016 17:21:57 +0200 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/gpu/drm/omapdrm/omap_dmm_tiler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c index f110965..c6a7197 100644 --- a/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +++ b/drivers/gpu/drm/omapdrm/omap_dmm_tiler.c @@ -735,7 +735,8 @@ static int omap_dmm_probe(struct platform_device *dev) /* alloc engines */ omap_dmm->engines = kcalloc(omap_dmm->num_engines, - sizeof(struct refill_engine), GFP_KERNEL); + sizeof(*omap_dmm->engines), + GFP_KERNEL); if (!omap_dmm->engines) { ret = -ENOMEM; goto fail;