From patchwork Mon Nov 27 17:59:57 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: 10077723 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 36A69602BD for ; Mon, 27 Nov 2017 18:00:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B110289CC for ; Mon, 27 Nov 2017 18:00:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E51F28AB8; Mon, 27 Nov 2017 18:00:28 +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 B106D289CC for ; Mon, 27 Nov 2017 18:00:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753489AbdK0SAI (ORCPT ); Mon, 27 Nov 2017 13:00:08 -0500 Received: from mout.web.de ([212.227.17.11]:60288 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753251AbdK0SAH (ORCPT ); Mon, 27 Nov 2017 13:00:07 -0500 Received: from [192.168.1.3] ([77.182.143.129]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LtFYd-1fHiFx0K2V-012nFH; Mon, 27 Nov 2017 18:59:58 +0100 Subject: [PATCH 2/3] video: au1100fb: Improve a size determination in au1100fb_drv_probe() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Cc: LKML , kernel-janitors@vger.kernel.org References: <980dc009-429b-ad88-966b-0e75808cbacc@users.sourceforge.net> Message-ID: <231de972-f0bf-18ce-e681-a29767c086ea@users.sourceforge.net> Date: Mon, 27 Nov 2017 18:59:57 +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: <980dc009-429b-ad88-966b-0e75808cbacc@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:It+mJavhL0cjx5YxO6XQuIQDJowApGWM/bZRU4DBMsQa26LaqhY BEVyO72kCj1CIu89Lxj9YfPEDuuFdGNue4LLUZjDz3I4UlwVNbbDtszFwE+8EeOxvV1P4dc kvY8sWuqrAVsM7qch5QS1YnAdAMQ+oXu//LYyeUYKVVfoa3lUukT4/OF3aY2dmpBOnTDI2B 1gUUmhiOu0e7FaoQaTg3Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:fAgv3PBFGao=:6QgyNWjqO5ti37pVRJSXtC n2LMf89yyFZH7cqdGVYbatB2Xnk5N3gNB+S+FnTwLEfM55TvRkA7+orgdSaE2b6dL/ZoLb4Rd VLV34+X0p+7HdhxK9UAleyw8YzcykxBodBoG0UHSPMbgUda6yd3anQd7/Ou5hGdE/MyL5G+JN 3jv0I1knHlzko3Rtxia6PBlSBuE7L0MikbZzXtnbLRvpKs6AyvRVgm2IvJFsjwWlyITq7mMWG GBloxJVDpnYTXYXIkq08HJ+P5RGr5/k5n9nUIYOF/jAW2rdGGiIUXzzJSv4bFiOqvLt2OU6xm qRN/afh0d8k5gMf0UkHcqDviAW5BaUEV7mLOBSDIbwdRdrmGh+5j23DvL8pm9r/XExcrDVBJf 8dMtErW7rMjwq4AJTd0id+hI0dDSa2w8HJDPXjwSPgh5kLJNAV03lAIR1jchNaGJofT6A3li4 /gX7wIg1qvJMSbz/2gKYE4dwAVuz7ssenWP5bU6zKfPNjWKySsYH9cQalHlE0+uTPPA+j+0Yn tDagq81HW/0MZjz8ueCARcOZGmPhKL6UzeO9d3zVakTW2OwptI1StLoZD0VtaYusQ20iS02h8 QYfiMSau2QGewMV2bf/pLB2+M5IjtOts7FeuQqHQ9Y9sQTRQFk8S6kD57FM1/AaPt9HMnwD6x CfY4ExVWy4r6pEOEz8EI5yBabmKb368BYfoihhnyz9iW3exnZ8ZPxbJ49xl/MB9OqbsDm4/9M T7Y+F3tLknqug1Xco5Je0nBKZnAlfgYphinr9Ux/hR7vZNHSrm5RoX7g8UUN+jOdwVaKTO9LK PCDG1ssm/Gkln1att8SIMWykZEIwvddx4ELgP3bIB5QXNFKF5M= 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: Mon, 27 Nov 2017 18:18:34 +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/au1100fb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/au1100fb.c b/drivers/video/fbdev/au1100fb.c index cae17d02d804..1e5b872f0da6 100644 --- a/drivers/video/fbdev/au1100fb.c +++ b/drivers/video/fbdev/au1100fb.c @@ -416,8 +416,7 @@ static int au1100fb_drv_probe(struct platform_device *dev) struct clk *c; /* Allocate new device private */ - fbdev = devm_kzalloc(&dev->dev, sizeof(struct au1100fb_device), - GFP_KERNEL); + fbdev = devm_kzalloc(&dev->dev, sizeof(*fbdev), GFP_KERNEL); if (!fbdev) return -ENOMEM;