From patchwork Sat Nov 25 20:47:46 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: 10075111 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 A113260383 for ; Sat, 25 Nov 2017 20:47:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91D7E28A0A for ; Sat, 25 Nov 2017 20:47:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 840D128E02; Sat, 25 Nov 2017 20:47:57 +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 266D828A0A for ; Sat, 25 Nov 2017 20:47:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7B696E158; Sat, 25 Nov 2017 20:47:56 +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 [217.72.192.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4352F6E158 for ; Sat, 25 Nov 2017 20:47:55 +0000 (UTC) Received: from [192.168.1.3] ([92.228.138.71]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LaCji-1f02n411mI-00m5mt; Sat, 25 Nov 2017 21:47:48 +0100 Subject: [PATCH 4/5] video: smscufx: Improve a size determination in two functions From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Steve Glendinning References: Message-ID: <0c32185c-afe2-5667-2455-6aa7e48e70c0@users.sourceforge.net> Date: Sat, 25 Nov 2017 21:47:46 +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:e5NINexszPjSmFKF2GFLK1g7X3RaFhR/ytCE5ui1rfEz9a7GTgB QC7tDd3pn6K7TefckZgYvDG5ZiowEWRxsBeHPnqBZuok6MCIi8kCBL7XCTwAUtKdAz+3N0m 6YJFmK8YrwKK61v+o/rawdy08crf5dEuomoCUzAR0x5ZTOyGfz28TmvE3Fo0k7JpHJExmXI bJniHBnZyiCsHSvniEB0g== X-UI-Out-Filterresults: notjunk:1; V01:K0:D/cDsURWTCM=:VpBw0keYEhUk+gqHJ+4o2k 7676QERob21i1+dIWcvNltNiT+2GaYdskd/n2go1ZDXWx90V/BPAbPX1Bkk8q/WoF7eOo1BuA sHxUtyL494X3JT0XqGdAaTPXSwxYyWQBjBGIIrASADo30b3qqCEvXvdFJHUK/vp2MaUcfLqo5 lOexVeO5SzNdMjgpSzz2vqCvT98N1OlMhpnFDJdzqQTpZEXMUxtvQgiwbPWIfQNGz2z3X4JRk 0BQQ7NKJVHQTL91Ohow9fxzG2vQ6s0pc5ExV0s5zNZ87jNsdPr/QO3qYoleIdjeHNCvufwMGy yniiHzHBfeDXAR37UpyM0eQ3hoULs66cPGOzcfjHjJkNVOLzIxIs5nWcCssn5dq4igP5tbGtl 16tan/iH8tm1GZ1ZCv97bqBhJnB1sK9UHFxOfQo1TCgIQ7Qs7m3iM3e831UDxjhBy41wkzO/Z h/rXwtamBf7Sqg71FN7ZJ/AopX+JOiuOoMCQGxC/7aJUDx9DeDiKD9e53Oztb6jLCk1hlGlEw ghUcvo2FKL7xj70J2GqqorGGxF+9zyTdr2tPZuc0BbQg/mdaMaMp6eQ+B8mQChPPJxd3xyzCD NIJ2T7EjYbx0OIPQ8hF1m14ZPyeM8/61wnjICWMaUSbhNldsm03YSZBPcENya/Sa8kIbS9kWC VT/ZzqoWjgGTeeftB8KQP5lc8edS14jtwmVmk2c+clhJ4ol1ig3Ift3jlbfUF6HN6d/R1iJG4 wmUOkYrPi4OrPhu3WapP7CpiR77kx4CqLbjCzjn3Wvlp5lsdKdZmGTKAJm5/Q6aiOqaTxd0zb nxDM4TksGZK8cFegm9uT/r4GJBx/XYCLjFYUPB4+aBSHDEOpuk= 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: Sat, 25 Nov 2017 21:10:22 +0100 Replace the specification of data structures by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/video/fbdev/smscufx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index c77fc45a76fc..03d35429e1b9 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1086,8 +1086,7 @@ static int ufx_ops_open(struct fb_info *info, int user) struct fb_deferred_io *fbdefio; - fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); - + fbdefio = kzalloc(sizeof(*fbdefio), GFP_KERNEL); if (fbdefio) { fbdefio->delay = UFX_DEFIO_WRITE_DELAY; fbdefio->deferred_io = ufx_dpy_deferred_io; @@ -1857,7 +1856,7 @@ static int ufx_alloc_urb_list(struct ufx_data *dev, int count, size_t size) INIT_LIST_HEAD(&dev->urbs.list); while (i < count) { - unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL); + unode = kzalloc(sizeof(*unode), GFP_KERNEL); if (!unode) break; unode->dev = dev;