From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Arnd Bergmann <arnd@arndb.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Bastian Stender <bst@pengutronix.de>, Jyri Sarha <jsarha@ti.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe()
Date: Sun, 07 Jan 2018 18:34:44 +0000 [thread overview]
Message-ID: <c2fc8e5c-e4d3-51da-451c-be70e0d3fef0@users.sourceforge.net> (raw)
In-Reply-To: <2091464.qzRHS0Wsad@amdc3058>
From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
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
next prev parent reply other threads:[~2018-01-07 18:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171125160425epcas5p43b2d94fbcc74745017c4c91ff08de685@epcas5p4.samsung.com>
2017-11-25 16:04 ` [PATCH 0/2] video: ssd1307fb: Adjustments for ssd1307fb_probe() SF Markus Elfring
2017-11-25 16:05 ` [PATCH 1/2] video: ssd1307fb: Delete an error message for a failed memory allocation in ssd1307fb_pr SF Markus Elfring
2017-11-25 16:06 ` [PATCH 2/2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe() SF Markus Elfring
2017-12-29 18:10 ` [PATCH 0/2] video: ssd1307fb: Adjustments for ssd1307fb_probe() Bartlomiej Zolnierkiewicz
2017-12-29 18:23 ` [0/2] " SF Markus Elfring
2018-01-07 18:34 ` SF Markus Elfring [this message]
2018-03-28 13:53 ` [PATCH v2] video: ssd1307fb: Improve a size determination in ssd1307fb_probe() Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c2fc8e5c-e4d3-51da-451c-be70e0d3fef0@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=arnd@arndb.de \
--cc=b.zolnierkie@samsung.com \
--cc=bst@pengutronix.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=jsarha@ti.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).