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: 10075115 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 CBE0660383 for ; Sat, 25 Nov 2017 20:48:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB0828A0A for ; Sat, 25 Nov 2017 20:48:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3D6628E02; Sat, 25 Nov 2017 20:48:11 +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 5132928A0A for ; Sat, 25 Nov 2017 20:48:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751673AbdKYUr6 (ORCPT ); Sat, 25 Nov 2017 15:47:58 -0500 Received: from mout.web.de ([217.72.192.78]:55169 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751024AbdKYUr5 (ORCPT ); Sat, 25 Nov 2017 15:47:57 -0500 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 Cc: LKML , kernel-janitors@vger.kernel.org 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= 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: 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;