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 2/4] GPU-DRM-QXL: Move three assignments in qxl_device_init()
Date: Thu, 22 Sep 2016 08:21:14 +0200 [thread overview]
Message-ID: <f7eb26ad-39be-2918-627b-5f4981d07808@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:33:54 +0200
Move the assignments for three data structure members to the end
so that they will only be performed if the desired resource allocations
succeeded by this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/qxl/qxl_kms.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c
index 76852f1..76780c2 100644
--- a/drivers/gpu/drm/qxl/qxl_kms.c
+++ b/drivers/gpu/drm/qxl/qxl_kms.c
@@ -212,10 +212,6 @@ static int qxl_device_init(struct qxl_device *qdev,
/* TODO - slot initialization should happen on reset. where is our
* reset handler? */
qdev->n_mem_slots = qdev->rom->slots_end;
- qdev->slot_gen_bits = qdev->rom->slot_gen_bits;
- qdev->slot_id_bits = qdev->rom->slot_id_bits;
- qdev->va_slot_mask =
- (~(uint64_t)0) >> (qdev->slot_id_bits + qdev->slot_gen_bits);
qdev->mem_slots = kmalloc_array(qdev->n_mem_slots,
sizeof(*qdev->mem_slots),
GFP_KERNEL);
@@ -260,7 +256,10 @@ static int qxl_device_init(struct qxl_device *qdev,
INIT_WORK(&qdev->gc_work, qxl_gc_work);
-
+ qdev->slot_gen_bits = qdev->rom->slot_gen_bits;
+ qdev->slot_id_bits = qdev->rom->slot_id_bits;
+ qdev->va_slot_mask =
+ (~(uint64_t)0) >> (qdev->slot_id_bits + qdev->slot_gen_bits);
return 0;
}
--
2.10.0
next prev parent reply other threads:[~2016-09-22 6:21 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 ` SF Markus Elfring [this message]
2016-09-22 10:09 ` [PATCH 2/4] GPU-DRM-QXL: Move three assignments " 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 ` [PATCH 3/4] GPU-DRM-QXL: Improve a size determination in qxl_driver_load() SF Markus Elfring
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=f7eb26ad-39be-2918-627b-5f4981d07808@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).