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: 10075469 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 33238602BD for ; Sun, 26 Nov 2017 17:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E8E1289F5 for ; Sun, 26 Nov 2017 17:42:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13A8D289FA; Sun, 26 Nov 2017 17:42:38 +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 C57A7289F5 for ; Sun, 26 Nov 2017 17:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751951AbdKZRmg (ORCPT ); Sun, 26 Nov 2017 12:42:36 -0500 Received: from mout.web.de ([212.227.15.4]:56140 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751297AbdKZRme (ORCPT ); Sun, 26 Nov 2017 12:42:34 -0500 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 Cc: LKML , kernel-janitors@vger.kernel.org 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= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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;