From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] omapfb: Use devm_kcalloc() in vrfb_probe()
Date: Wed, 26 Apr 2017 09:20:07 +0000 [thread overview]
Message-ID: <4a7b1751-4319-4bde-cf26-2de2a4096c68@users.sourceforge.net> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 26 Apr 2017 11:08:30 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "devm_kcalloc".
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/video/fbdev/omap2/omapfb/vrfb.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/video/fbdev/omap2/omapfb/vrfb.c b/drivers/video/fbdev/omap2/omapfb/vrfb.c
index f346b02eee1d..54b51a7a290a 100644
--- a/drivers/video/fbdev/omap2/omapfb/vrfb.c
+++ b/drivers/video/fbdev/omap2/omapfb/vrfb.c
@@ -358,11 +358,7 @@ static int __init vrfb_probe(struct platform_device *pdev)
return PTR_ERR(vrfb_base);
num_ctxs = pdev->num_resources - 1;
-
- ctxs = devm_kzalloc(&pdev->dev,
- sizeof(struct vrfb_ctx) * num_ctxs,
- GFP_KERNEL);
-
+ ctxs = devm_kcalloc(&pdev->dev, num_ctxs, sizeof(*ctxs), GFP_KERNEL);
if (!ctxs)
return -ENOMEM;
--
2.12.2
next reply other threads:[~2017-04-26 9:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20170426092018epcas4p343e69e32255faa796e7c55c3e89e40f2@epcas4p3.samsung.com>
2017-04-26 9:20 ` SF Markus Elfring [this message]
2017-05-11 14:27 ` [PATCH] omapfb: Use devm_kcalloc() in vrfb_probe() Bartlomiej Zolnierkiewicz
2017-05-11 15:22 ` Bartlomiej Zolnierkiewicz
2017-05-12 7:07 ` Geert Uytterhoeven
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=4a7b1751-4319-4bde-cf26-2de2a4096c68@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=b.zolnierkie@samsung.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@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).