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: 10077719 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 1D7F1602BD for ; Mon, 27 Nov 2017 18:00:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 12D582850E for ; Mon, 27 Nov 2017 18:00:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0780B2886E; Mon, 27 Nov 2017 18:00:07 +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 7B7802850E for ; Mon, 27 Nov 2017 18:00:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C669B6E351; Mon, 27 Nov 2017 18:00:05 +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.17.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9985B6E351 for ; Mon, 27 Nov 2017 18:00:04 +0000 (UTC) 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 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= 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: 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;