From patchwork Sat Nov 25 16:06:37 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: 10074861 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 BD3FD602BC for ; Sat, 25 Nov 2017 16:07:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF5C428F5A for ; Sat, 25 Nov 2017 16:07:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A43F028F67; Sat, 25 Nov 2017 16:07:12 +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 4F3D528F5A for ; Sat, 25 Nov 2017 16:07:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751712AbdKYQHL (ORCPT ); Sat, 25 Nov 2017 11:07:11 -0500 Received: from mout.web.de ([212.227.17.11]:63922 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751632AbdKYQHK (ORCPT ); Sat, 25 Nov 2017 11:07:10 -0500 Received: from [192.168.1.3] ([92.228.138.71]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LtWwK-1fJHmz3E7I-010wd0; Sat, 25 Nov 2017 17:06:53 +0100 Subject: [PATCH 2/2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe() From: SF Markus Elfring To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Arnd Bergmann , Bartlomiej Zolnierkiewicz , Bastian Stender , Jyri Sarha , Tomi Valkeinen Cc: LKML , kernel-janitors@vger.kernel.org References: <9433118e-4c2b-db31-7064-df692a99c1b2@users.sourceforge.net> Message-ID: <37c07df9-5d12-63e3-48a6-c349b146b1dc@users.sourceforge.net> Date: Sat, 25 Nov 2017 17:06:37 +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: <9433118e-4c2b-db31-7064-df692a99c1b2@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:q/d6pV7aMxuc2X+BUmX9hJFPL8QM9D/jo5RipHUgcJRcmzUlE4O 14ox6UQ5RLiAyiLZrC6OlOHThMZ4LSBQDDseHyx1AY3r6e0ATc0AZp+tituDwrVyNz28eBE pitDgAj2TXzzQRXfLGOkQrhw9+rW2Wmp8by1/ub4DcJMSrREPl0+tSBkizE5iLSsMIOWhk2 mmSXcEJE+b4o6J2g+b3og== X-UI-Out-Filterresults: notjunk:1; V01:K0:LI3sqpAtbvA=:IFJ94E7ZqcytrXzBiXCGxI Ls/ZeyLaGjrksSmKXlg6lCwiub5rN6Eet1O7FVlX1esl4WB0Ry+sRpd+4vlZ3BuON9xgSMe0Z t2lpswt+l/P6v0H7eLj3WhvKTknBWkTKdB1m/PNsZKgpKL7udHA580X2v8pNJZgpiMSZYNZX+ 9MlYowt+aoyYw0UAFpynvTTlM7MsCyafSMt+es6HPz5UpapOhwrAZt+CB8O8HIA0SSA7ZqyON 90Ef5fIXemf5bLSqsfc5jeE4GvfuZJCGkS/NlUuqAulY2pZAEnZGzTGsENlxGdxtzTFe45mdx sfLhXBAtUGHSM45FK2hvYtWIw7nCC/z03VIIR66t4XTn3Q5c1j2X4HgKaYRI/V0BFia1bShAF 1Vu6ncjmZvo9N9t6GVsAiN4sxE5cxOUe8YiqAryjg24RJLp5rqLWsoA4mF4Y4sSMwyGH2sNCL 38HhtZZ5CtGIfYAtKZ0zOUKL2vK5RrSoCLk7dgE9toyLWxnv94wUn4HaVQYE9gj7OL2TXuD9e gzsrE3UUu7dSQV76HvFi2iRHGYafN2jxwoyvW81Qjeavmao5roFkR6Bsr7bA5TpzRPQPdf7oL mPvcYsGLZHnzpF0gX+9yyd/3LgzIGvkk8muFCJm5munwfNf63q6D1cbLD0ZkY4ksLd3W0jxGE VZU8n4J/Lq/7GDvqebHLWxOWfxA83vd37st/G6HYnY6FMjEOYZAN9eLvpFkLgFSoeN3V5WeLT HtbZwCfw2g12voHz5eev4+2gSFK6PA7+X0NlJk8CX8HL28oGOloHOtjk6W7bJ4zkJ+beH2C0o EdHw3mqBPgoRPsAZANB02kdQfyu3KhxlnF/Px0MUG/i1Lr/IFs= 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 16:50:26 +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/ssd1307fb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index fb0ef1922d49..bb32b2dd1f7a 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -628,7 +628,8 @@ static int ssd1307fb_probe(struct i2c_client *client, goto fb_alloc_error; } - ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(struct fb_deferred_io), GFP_KERNEL); + ssd1307fb_defio = devm_kzalloc(&client->dev, sizeof(*ssd1307fb_defio), + GFP_KERNEL); if (!ssd1307fb_defio) { ret = -ENOMEM; goto fb_alloc_error;