From patchwork Tue Dec 5 17:13:33 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: 10093481 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 0295A6035E for ; Tue, 5 Dec 2017 17:14:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7AF2975F for ; Tue, 5 Dec 2017 17:14:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D39B82984A; Tue, 5 Dec 2017 17:14:22 +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 8EFAF2975F for ; Tue, 5 Dec 2017 17:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752879AbdLEROV (ORCPT ); Tue, 5 Dec 2017 12:14:21 -0500 Received: from mout.web.de ([212.227.15.3]:63303 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752413AbdLEROU (ORCPT ); Tue, 5 Dec 2017 12:14:20 -0500 Received: from [192.168.1.3] ([77.181.246.157]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MMIdp-1eS2Up1rQ5-007zaq; Tue, 05 Dec 2017 18:14:10 +0100 Subject: [PATCH 2/2] video: ARM CLCD: Improve a size determination in clcdfb_probe() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Russell King Cc: LKML , kernel-janitors@vger.kernel.org References: <107ed35f-1775-14e0-a7b5-20e7ee02ac16@users.sourceforge.net> Message-ID: <3656de6d-53cc-f6a4-1950-71fc989c79a4@users.sourceforge.net> Date: Tue, 5 Dec 2017 18:13:33 +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: <107ed35f-1775-14e0-a7b5-20e7ee02ac16@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:zjYxGSYUzcvmGankbvl/4wHth1VFFBmokfBoTBLNc0bNqIH13Sz oxG1i3CaH9vo8CVQZQ2z588c9aswLmCsj3WcQLP34div4sqc4sJoQThAC4q2DQlbZNT/NHV z2WchiKTRKTN+oxifyJETlqFBlKyOm2i6EdpcGBT4KAJvV1C/DShK2qrLtVlO+Qi6By37RI eoV5I8CSORhyED8SRBRMw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Uw37gHBaYlA=:s4NlXLub3jbo9PNL7k6zMu 5hoguGmAvyWpwT58ECp4/CpXTuolHxd04ARdX+EroOca7Yq+I8+kLYwy6xLwsB3VwGDO5zMWm MjOq+XicQMjnwzKIgNPI3cRVOdA0O4XfTNoMlJQKHCw+Ryl7cYdWW/+4lplpo2jsFKjo4Em9Z Wl9skPcb1PH4yDsuouzM62xL8cjZGmK11e8/jcHjhUpDbAoWQ5gN34GAFwik6KjQuyiLmAtjn lmwcv+UuyVaOsFNTraSXykO5Ko/DoSTKiBl/JPsNVfCepzQ4leoPsFqublSEIMrDqsVbkeCbl PEeSk7UgUuL/Zyi86ctIrBz2wZpNDkbXyLLjXUs0L/tKRDU6mNaajxWN23n6BYVv1zyNBX14X a+3bW3voIy0eJDjLkCoemUg7QyiToiOw36d5A/hxhMPE6EU/Y4wwRjG/KZifQgg07IndamA0M L/tTLCdE4cDWHx923OFMGk1g/726RNEEwdUtha/qdeHu/sg28wPsUcQWU8VrRxsDoiO7zYYWL wzCRbIwCtr084HN0+PPDujvuc74mDwpZI1XQOX9gDKXfM/NKMxai0ERJ2VvGYDtV11rk7P0hm fKgK6oeW2ZvzBJBwxNFuV5qZS/tjfXZbchRFKhv/Ad0qVpSDrKR3YMgalHhw9w4TJmIscRJ/B KLrGT2JUktw1Dg52CJzd9MaKgjZlWm/zPBmIEmIDLwRpSDwyQbDxZYAr6YZbVcz/G3bSMFg5U JR4YRNkUQQ4JnBPF2BWo0nFOp6BrDpoWtOV5IWTLwpUi4zs3LFvp3M1amhwSc4vknztiSqhc6 Q+yJQBuUKRzsg/RQSpmoxeskibiOfJSyS7UK1W7ieo6JcMt+Hhu+9jgZSykQgAoWojraZbV 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: Tue, 5 Dec 2017 17:53:19 +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/amba-clcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c index 79f5ebf23fcd..38c1f324ce15 100644 --- a/drivers/video/fbdev/amba-clcd.c +++ b/drivers/video/fbdev/amba-clcd.c @@ -967,7 +967,7 @@ static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id) goto out; } - fb = kzalloc(sizeof(struct clcd_fb), GFP_KERNEL); + fb = kzalloc(sizeof(*fb), GFP_KERNEL); if (!fb) { ret = -ENOMEM; goto free_region;