Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754531AbeAGSfE (ORCPT + 1 other); Sun, 7 Jan 2018 13:35:04 -0500 Received: from mout.web.de ([212.227.15.4]:55401 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754469AbeAGSfB (ORCPT ); Sun, 7 Jan 2018 13:35:01 -0500 Subject: [PATCH v2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe() To: Arnd Bergmann , Bartlomiej Zolnierkiewicz , Bastian Stender , Jyri Sarha , Tomi Valkeinen , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: LKML , kernel-janitors@vger.kernel.org References: <9433118e-4c2b-db31-7064-df692a99c1b2@users.sourceforge.net> <2091464.qzRHS0Wsad@amdc3058> From: SF Markus Elfring Message-ID: Date: Sun, 7 Jan 2018 19:34:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <2091464.qzRHS0Wsad@amdc3058> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6wCwJ7vGZa/4a0iXHxPojq+08GjBkMYc8WjOkeXc/kj5Cbn/65r edoXFX2AT3fz/mBYBETB3XzHqFOmMbu+oWKBOJTaTJpx45KIXwAdJkC7Nlte7DJia0wtP1N GVD0NaLZ9mG5JQhUUv4NBiLW55jGNSJpiii/B4VTlGvMedUTlQP5L5wwvWfkIyIkiccB9NR 2NDysSKTCOwpmxxlQWr4w== X-UI-Out-Filterresults: notjunk:1;V01:K0:3jv1yNH0yxs=:syNP6AefHF09CKlvmKb1+U 5uff+ZLTowRaSK44Ky2sMWzRbBx+vMWwMfSD1AwDdik4RQ7hnmMLESPUiNqu5IvABgzAzGK3/ ma7ZlPo45f+V3doiEIxdxUVQNOiHkqSbmya13Lrcd9NezjBESs3OK51PwcwMhdtW0oVa19oXr ShdUaFHRM4W5ARUoBIyYBws4WW837UWzZnj8seRgfCGq/XGTFUqCkj2C7kSQkKzqtk88YV5af 2rm7ziOsaxy5+QBYElUByb6/LOqmHxeGw5w/1j7kgxIBMYhfjSj5Gi8jahRP1PYXomUd/aE4G gBnWfkXLqPtXCM1BHwFS2EeYcu06SbyNWSj8KyJHIrjHkKeh4GsCi0TQ0mznQWeZRgSIM8Pxo kTX5CapDhUex1P9gWAaHVPdDAU78p74YeDWnv3M4GkK5XAreQqMPi6A+WGQbbE9v8yg0UuCZN IcgpFMlxf0KMHmNTK53mRF5v4cgePn9OshLGd+HCPHzPxrDO3R1zLheOaAlSaNRoAs9MMzKTb AEwPoUhJN5kCrFjr9Pd+qajYfu0RrSIitqGaRVgJz68yQkerFEMwSlhCS0kNjLh7F3c6G+I8x 6ZCw+04DzyZ3TbR9eUPRJLjIQ6NuVIGZS0kHaW7ZZ4nhZvYBz+mBnJsyQFfpvscRnkcvAlrCU /w6IcAlfSWbJfqwXA1J/MlbXXny6s7rpsVZvhuGypvsCQpAvHRTi/bSS0WUFM77bPG/FNKOiI 74zIK+4iswE2IdSOQRTVAwTyDd4dziDAO6eBuButDAIlil5cBHguYwf8nBl8UvmdI4esaxBas t6/ZghmCsM9XP/7jBXoB/MJW+2vZc69rW6I5AU2UsSa6Q2lbRo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Sun, 7 Jan 2018 19:27:28 +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 --- v2: This update suggestion was rebased on source files from the software "Linux next-20180105". 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 f599520374dd..6439231f2db2 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) { dev_err(&client->dev, "Couldn't allocate deferred io.\n"); ret = -ENOMEM; -- 2.15.1