From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org,
"Bhaktipriya Shridhar" <bhaktipriya96@gmail.com>,
"Daniel Vetter" <daniel.vetter@ffwll.ch>,
"David Airlie" <airlied@linux.ie>,
"Noralf Trønnes" <noralf@tronnes.org>,
"Tejun Heo" <tj@kernel.org>,
"Thierry Reding" <treding@nvidia.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 3/4] GPU-DRM-QXL: Improve a size determination in qxl_driver_load()
Date: Thu, 22 Sep 2016 08:22:29 +0200 [thread overview]
Message-ID: <424ac093-cbe5-17f8-6e03-5e25d7e04269@users.sourceforge.net> (raw)
In-Reply-To: <ce810580-cc2b-32cc-a852-a355374c2100@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 21 Sep 2016 22:48:34 +0200
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/qxl/qxl_kms.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
index 76780c2..f8f0261 100644
--- a/drivers/gpu/drm/qxl/qxl_kms.c
+++ b/drivers/gpu/drm/qxl/qxl_kms.c
@@ -306,7 +306,7 @@ int qxl_driver_load(struct drm_device *dev, unsigned long flags)
struct qxl_device *qdev;
int r;
- qdev = kzalloc(sizeof(struct qxl_device), GFP_KERNEL);
+ qdev = kzalloc(sizeof(*qdev), GFP_KERNEL);
if (qdev == NULL)
return -ENOMEM;
--
2.10.0
next prev parent reply other threads:[~2016-09-22 6:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-22 6:18 [PATCH 0/4] GPU-DRM-QXL: Fine-tuning for three function implementations SF Markus Elfring
2016-09-22 6:20 ` [PATCH 1/4] GPU-DRM-QXL: Use kmalloc_array() in qxl_device_init() SF Markus Elfring
2016-09-22 6:21 ` [PATCH 2/4] GPU-DRM-QXL: Move three assignments " SF Markus Elfring
2016-09-22 10:09 ` Dan Carpenter
2016-09-22 13:11 ` SF Markus Elfring
2016-09-22 15:46 ` Gerd Hoffmann
2016-09-22 17:16 ` SF Markus Elfring
2016-09-22 20:24 ` Gerd Hoffmann
2016-09-22 20:24 ` Dan Carpenter
2016-09-23 7:25 ` Sean Paul
2016-09-23 7:53 ` Dave Airlie
2016-09-23 8:50 ` SF Markus Elfring
2016-09-23 13:30 ` Emil Velikov
2016-09-23 14:23 ` SF Markus Elfring
2016-09-23 8:42 ` SF Markus Elfring
2016-09-23 8:34 ` SF Markus Elfring
2016-09-22 6:22 ` SF Markus Elfring [this message]
2016-09-22 6:23 ` [PATCH 4/4] GPU-DRM-QXL: Adjust checks for null pointers in three functions 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=424ac093-cbe5-17f8-6e03-5e25d7e04269@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=airlied@linux.ie \
--cc=bhaktipriya96@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noralf@tronnes.org \
--cc=tj@kernel.org \
--cc=treding@nvidia.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).