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: 10093479 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 B4BDD6035E for ; Tue, 5 Dec 2017 17:14:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 991F0296F9 for ; Tue, 5 Dec 2017 17:14:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DD2729787; Tue, 5 Dec 2017 17:14:20 +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 34334296F9 for ; Tue, 5 Dec 2017 17:14:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4FADB6E5DA; Tue, 5 Dec 2017 17:14:19 +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.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id E24E96E5DA for ; Tue, 5 Dec 2017 17:14:17 +0000 (UTC) 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 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 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: 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;