From patchwork Sun Nov 26 10:18:26 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: 10075253 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 637B7602BD for ; Sun, 26 Nov 2017 10:18:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C5B728E39 for ; Sun, 26 Nov 2017 10:18:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50F9C28E3B; Sun, 26 Nov 2017 10:18:56 +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 EFF4628E39 for ; Sun, 26 Nov 2017 10:18:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752163AbdKZKSy (ORCPT ); Sun, 26 Nov 2017 05:18:54 -0500 Received: from mout.web.de ([212.227.15.4]:59096 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751717AbdKZKSx (ORCPT ); Sun, 26 Nov 2017 05:18:53 -0500 Received: from [192.168.1.3] ([78.49.168.181]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0Ljron-1eq2yk2rur-00bqHi; Sun, 26 Nov 2017 11:18:31 +0100 Subject: [PATCH 2/4] video: sm501fb: Improve a size determination in sm501fb_probe() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Alexey Khoroshilov , Bartlomiej Zolnierkiewicz , Bhumika Goyal , Colin Ian King , "Gustavo A. R. Silva" , Sudip Mukherjee Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <08ed1e90-5714-04b7-b3dc-067a3d9bc38b@users.sourceforge.net> Date: Sun, 26 Nov 2017 11:18:26 +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: Content-Language: en-GB X-Provags-ID: V03:K0:MF5x9CpxLz4QhtcERiY/K6+Cet2jm9jJ3pRNGZmr4MKDfZpakCH 4FNPh6usRklDyd+KM1fKxCdTtDlW9CnfaSmePsHWWLp+yep+osjqORf2qstPDOBQ7V1/F4u WAB/kzWx2Wj00Ep4A/mQbbuap8ql2o5ugrJFFpGMmJvPlHfDG5IovdNq4zg1YMc4k/qYzeF VFCBVLcwHgH45uaT+E33Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZwiM2DCjezc=:ItfaZINylRaY3zUUSz/aNU CQtvP4wbNWGI9ng8VGEi3koxx9YORR6ZmyVr95DiozI2Q5cv1MBfuv6R4/aWF5siJ8b3h7Tjc DIolKXvUfa1fAL4qWtYbqd38s4vOOqFNV/p9QgYWIIun2MJqG0WSM/mKmyUn6LilZuWRcFI91 yq5q52sJDR8Jtq4T74rcxZf+oNhzkAs1v92vbIU3bpk22Ug/zs2Smo6Yv2QI/S6hOSBs6zt8h nhX2EFD52UZKiY+ii3qliGQ7ZRcPeruChWPUs8Y1R7tTlat/Hrj5pq1UWu6U8FiHyOi854F/O eUKyqE5OAhQYVW09nzoSgmPXrzZkfvBQHQOmrwOYjP+/c63bEZdMYKwLpP6MIqTbFdcm87ANN BfJ/15foqwz+DN0L5rnkSZyvkEUVS1sVipBQCS2tbvAAU/JZZfyUAiz0G8a6TbhgLN9Qyig3/ tcDvFZs3lsg2/KFyZa6qiy19kAdR2E358d16WI+EgR7WMe/kTp6CzmgMrzpf2lGv/WBb4me9n +33mJlYnichkzMciGFZLtJm3h+sYRUONUcoH4QYKMPM7SEpYwGJg5THBJbPq/axQDNddr/iC0 o3q7zWNowFSUQLNzZB5zWfDLA+7xSN7FmJxoS1QXnwZy2C1L1eAl4Uu+aZVfadXnnrfjrgiEe 1wYOQw/aubUZJLsxdtoYnJoE4Y1SWF56xWGNEB9d5ALqoCU9rfxA2CALtwIBKqIvz0iitfOh8 XAILH0/KAm/79htn79yzBxHnCtWdLN9G2knwNB4gptcZ8E7GohpSt3DDCTA/FnzfPH99NTn3f d20/eNtxSW++3CkPaS024g3jDcZcwODlJP4Vd4wzvM8INRjdf8= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 26 Nov 2017 10:22:37 +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/sm501fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index e8301c4e7d44..80bda5a655c0 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -1932,8 +1932,7 @@ static int sm501fb_probe(struct platform_device *pdev) int ret; /* allocate our framebuffers */ - - info = kzalloc(sizeof(struct sm501fb_info), GFP_KERNEL); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM;