From patchwork Sun Nov 26 17:42:23 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: 10075465 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 B2FD2602BD for ; Sun, 26 Nov 2017 17:42:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E434289F5 for ; Sun, 26 Nov 2017 17:42:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93341289FA; Sun, 26 Nov 2017 17:42:34 +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 3249B289F5 for ; Sun, 26 Nov 2017 17:42:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 865FB89C05; Sun, 26 Nov 2017 17:42:33 +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.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5E15989C05 for ; Sun, 26 Nov 2017 17:42:32 +0000 (UTC) Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Lb1nV-1eyuDZ0Koz-00kfY5; Sun, 26 Nov 2017 18:42:24 +0100 Subject: [PATCH 2/3] video: omap: Improve a size determination in omapfb_do_probe() From: SF Markus Elfring To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Tomi Valkeinen References: <1e17c727-884d-5745-2726-48dd3a53c32f@users.sourceforge.net> Message-ID: <3e367b91-a7ae-fc2e-f145-d62cfee14c77@users.sourceforge.net> Date: Sun, 26 Nov 2017 18:42:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1e17c727-884d-5745-2726-48dd3a53c32f@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:NMMyZhq7AuZKwH5f5wDmNYVwulQUEZQPuMtoXf58IRHxlLpLfAU jFEMmiF2HpGF5dMuR8bgXOm6IAvsErIE2YmsDAAKGP98WQzW3gbkhFLG/KQLCICLsICSHHy bdZV3LCQiJfGyI6APiwgZ1POUhEkN+vQoSkW1ylMwe6L390ztkKjfCLFioO+pBt7/oPTjVi ITgf1As0B1tqAF6hzeFrA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZT+29vgBn7c=:2OEu9z1oiNcwim+kqRQIX+ JMLBuoSI+4jHkqF52mG0IipL2KNqB/tSjUckwy63RQsWq2lQFMm/IgSpQxaj1SWlWNSsNljt3 iO8FY/ZTSX+PoAMR+WICcxgR+A1MUrpSVw2YItfla0zc6gScMqiReNk/LJlTY0MkOP9U9ML8X lwTIuXmS3alcGD6UwR2Vxt6mJcCLSVyuVRDH+zzMjvsSnWlsHmcXlnTOnhRDeI1wuZkw+oPIq yb58uND3CBUzSANbX1/XXmL7Oy0/q+LhuzcdQ5eSpxsuT4GIqU4jNZdxnCVLaOzoelQ/+o0na OLJj6T6LgMM1zSqDoY627OQafI8mBQEe33qFkhVVs2dUIAnGqsFp+9nS8h9NPHTeZGYxBT5sf D2sKxYuU9yEekrG+egMjnn48u5ojFWo5Ky8ci0cRu0OjEHr1A2Yrclf8Gh9Uf6bshK68ICGY1 L5kcOkn4osGGRTVIWlwLkOJYzhvnZPUZoMLgaeIr0yhbDoyM36j/SdwEaEvT2Nj6mkLnxE/QE QwvP5no5zgzM7WZ9zOXZwYbx+T1ZRsWiaGMrzxAlqATcB8yt14QXYCMVuW+qeKDWNCcHA5mAD PGrYdZO0wxlyX81w1X83ep8khrU9VhPwV6vnYOipnii+R0cRU0fi7LyBVreWqGETJ2lDk4Qqr 66467iBgOZLComnwnR5i7fbDOqaBSBYU1W/lZqxj2TLWb4mQnIUUAbPKFdCX/HM0csEVlXxe6 9axxrg4badize4zJNKtGCAMsgXtAqy68eG/la1EUYa6aPOn9Cxp0BkQ7tUrTnPvxxTG2drTue SdJHAuAJbwuhloAJI9qAYi9oikuh6dnTfA4Kh6piiePYpVxyJk= Cc: 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: Sun, 26 Nov 2017 18:16:20 +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. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/video/fbdev/omap/omapfb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index b0d91524bf6c..c47059430ca8 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1645,7 +1645,7 @@ static int omapfb_do_probe(struct platform_device *pdev, goto cleanup; } - fbdev = kzalloc(sizeof(struct omapfb_device), GFP_KERNEL); + fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL); if (fbdev == NULL) { r = -ENOMEM; goto cleanup;