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>,
Bernie Thompson <bernie@plugable.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 3/4] video: udlfb: Improve a size determination in dlfb_alloc_urb_list()
Date: Fri, 24 Nov 2017 20:52:19 +0000 [thread overview]
Message-ID: <d55401c9-1fbb-93b9-40de-2b93396e8def@users.sourceforge.net> (raw)
In-Reply-To: <6fb11bb4-2c1d-a939-087b-de31c42328b9@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 24 Nov 2017 21:30:37 +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/udlfb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
index cb2d59ca67a4..059883962698 100644
--- a/drivers/video/fbdev/udlfb.c
+++ b/drivers/video/fbdev/udlfb.c
@@ -1867,7 +1867,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size)
INIT_LIST_HEAD(&dev->urbs.list);
while (i < count) {
- unode = kzalloc(sizeof(struct urb_node), GFP_KERNEL);
+ unode = kzalloc(sizeof(*unode), GFP_KERNEL);
if (!unode)
break;
unode->dev = dev;
--
2.15.0
next prev parent reply other threads:[~2017-11-24 20:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171124204825epcas1p41626d598b6e437dfb4c6b648e3730cc1@epcas1p4.samsung.com>
2017-11-24 20:48 ` [PATCH 0/4] video-UDLFB: Adjustments for five function implementations SF Markus Elfring
2017-11-24 20:49 ` [PATCH 1/4] video: udlfb: Delete an error message for a failed memory allocation in two functions SF Markus Elfring
2017-11-24 20:51 ` [PATCH 2/4] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer() SF Markus Elfring
2017-11-24 20:52 ` SF Markus Elfring [this message]
2017-11-24 20:54 ` [PATCH 4/4] video: udlfb: Delete an unnecessary return statement in two functions SF Markus Elfring
2017-12-29 18:02 ` [PATCH 0/4] video-UDLFB: Adjustments for five function implementations Bartlomiej Zolnierkiewicz
2017-12-29 18:10 ` [0/4] " SF Markus Elfring
2018-01-04 17:08 ` Bartlomiej Zolnierkiewicz
2018-01-04 17:44 ` SF Markus Elfring
2018-01-07 13:33 ` [PATCH v2 0/2] video-UDLFB: Adjustments for dlfb_realloc_framebuffer() SF Markus Elfring
2018-01-07 13:34 ` [PATCH v2 1/2] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer() SF Markus Elfring
2018-03-28 13:42 ` [PATCH v2 1/2] video: udlfb: Return an error code only as a constant in dlfb_realloc_framebuffer Bartlomiej Zolnierkiewicz
2018-01-07 13:38 ` [PATCH v2 2/2] video: udlfb: Delete an error message for a failed memory allocation in dlfb_realloc_ 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=d55401c9-1fbb-93b9-40de-2b93396e8def@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=b.zolnierkie@samsung.com \
--cc=bernie@plugable.com \
--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