From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
Ben Skeggs <bskeggs@redhat.com>, David Airlie <airlied@linux.ie>,
Martin Peres <martin.peres@free.fr>,
Roy Spliet <rspliet@eclipso.eu>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, trivial@kernel.org,
Julia Lawall <julia.lawall@lip6.fr>
Subject: [PATCH 4/5] GPU-DRM-nouveau: Adjust a kzalloc() call in gt215_ram_new()
Date: Wed, 21 Sep 2016 09:28:00 +0200 [thread overview]
Message-ID: <0d8628f4-7254-2600-9ee4-e72b4e0ee6f6@users.sourceforge.net> (raw)
In-Reply-To: <5bcff2ec-f3bd-ab9c-e13d-3a4f5cf7c73b@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 21 Sep 2016 08:44:38 +0200
The script "checkpatch.pl" can point out that assignments should usually
not be performed within condition checks.
Thus move the assignment for one local variable to a separate statement
in this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
index cb50539..edbe8e4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c
@@ -940,7 +940,8 @@ gt215_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
struct gt215_ram *ram;
int ret, i;
- if (!(ram = kzalloc(sizeof(*ram), GFP_KERNEL)))
+ ram = kzalloc(sizeof(*ram), GFP_KERNEL);
+ if (!ram)
return -ENOMEM;
*pram = &ram->base;
--
2.10.0
next prev parent reply other threads:[~2016-09-21 7:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 7:23 [PATCH 0/5] GPU-DRM-nouveau: Fine-tuning for five function implementations SF Markus Elfring
2016-09-21 7:24 ` [PATCH 1/5] GPU-DRM-nouveau: Use kmalloc_array() in nvbios_iccsense_parse() SF Markus Elfring
2016-09-21 7:25 ` [PATCH 2/5] GPU-DRM-nouveau: Use kmalloc_array() in gt215_link_train() SF Markus Elfring
2016-09-21 7:26 ` [PATCH 3/5] GPU-DRM-nouveau: Delete unnecessary braces SF Markus Elfring
2016-09-21 8:47 ` Dan Carpenter
2016-09-21 13:20 ` SF Markus Elfring
2016-09-21 7:28 ` SF Markus Elfring [this message]
2016-09-21 7:29 ` [PATCH 5/5] GPU-DRM-nouveau: Add space after an "if" 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=0d8628f4-7254-2600-9ee4-e72b4e0ee6f6@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=airlied@linux.ie \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.peres@free.fr \
--cc=nouveau@lists.freedesktop.org \
--cc=rspliet@eclipso.eu \
--cc=trivial@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).