From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/5] radeon_backlight: Improve a size determination in radeonfb_bl_init()
Date: Mon, 27 Nov 2017 21:25:38 +0000 [thread overview]
Message-ID: <a1b1f11e-082e-841a-565e-bcf67f5cf15f@users.sourceforge.net> (raw)
In-Reply-To: <93c99f89-2d97-0e95-fe57-7b7a0824e864@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 27 Nov 2017 21:30:06 +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>
---
drivers/video/fbdev/aty/radeon_backlight.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/aty/radeon_backlight.c b/drivers/video/fbdev/aty/radeon_backlight.c
index ce5b22d710b3..78c36c8d5e57 100644
--- a/drivers/video/fbdev/aty/radeon_backlight.c
+++ b/drivers/video/fbdev/aty/radeon_backlight.c
@@ -143,7 +143,7 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
return;
#endif
- pdata = kmalloc(sizeof(struct radeon_bl_privdata), GFP_KERNEL);
+ pdata = kmalloc(sizeof(*pdata), GFP_KERNEL);
if (!pdata)
goto error;
--
2.15.0
next prev parent reply other threads:[~2017-11-27 21:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 21:20 [PATCH 0/5] Radeon backlight: Adjustments for radeonfb_bl_init() SF Markus Elfring
2017-11-27 21:21 ` [PATCH 1/5] radeon_backlight: Delete an error message for a failed memory allocation in radeonfb_bl_ SF Markus Elfring
2017-11-27 21:25 ` SF Markus Elfring [this message]
2017-11-27 21:26 ` [PATCH 3/5] radeon_backlight: Delete an unnecessary return statement in radeonfb_bl_init() SF Markus Elfring
2017-11-27 21:27 ` [PATCH 4/5] radeon_backlight: Return directly after a failed kmalloc() " SF Markus Elfring
2017-11-27 21:28 ` [PATCH 5/5] radeon_backlight: Delete a jump target " SF Markus Elfring
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=a1b1f11e-082e-841a-565e-bcf67f5cf15f@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=b.zolnierkie@samsung.com \
--cc=benh@kernel.crashing.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).