From: sunran001@208suo.com
To: airlied@gmail.com, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/nouveau/i2c: do not use assignment in if condition
Date: Mon, 10 Jul 2023 14:37:01 +0800 [thread overview]
Message-ID: <2156ff3c1fcec8914f1493ac6d7cd807@208suo.com> (raw)
In-Reply-To: <20230710063529.53769-1-xujianghui@cdjrlc.com>
Assignments in if condition are less readable and error-prone. Fixes
also checkpatch warning:
ERROR: do not use assignment in if condition
Signed-off-by: Ran Sun <sunran001@208suo.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c
index 96bbdda0f439..a1cf406ff141 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/busgf119.c
@@ -85,7 +85,8 @@ gf119_i2c_bus_new(struct nvkm_i2c_pad *pad, int id, u8
drive,
{
struct gf119_i2c_bus *bus;
- if (!(bus = kzalloc(sizeof(*bus), GFP_KERNEL)))
+ bus = kzalloc(sizeof(*bus), GFP_KERNEL);
+ if (!bus)
return -ENOMEM;
*pbus = &bus->base;
next parent reply other threads:[~2023-07-10 6:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230710063529.53769-1-xujianghui@cdjrlc.com>
2023-07-10 6:37 ` sunran001 [this message]
2023-07-13 9:08 ` Karol Herbst
[not found] <20230710062932.53655-1-xujianghui@cdjrlc.com>
2023-07-10 6:31 ` sunran001
2023-07-13 9:11 ` Karol Herbst
[not found] <20230710055219.53210-1-xujianghui@cdjrlc.com>
2023-07-10 6:11 ` sunran001
[not found] <20230710040334.53045-1-xujianghui@cdjrlc.com>
2023-07-10 4:05 ` sunran001
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=2156ff3c1fcec8914f1493ac6d7cd807@208suo.com \
--to=sunran001@208suo.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.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
all inboxes | Powered by JetHome®