[<prev] [next>] [day] [month] [year] [list]
Message-ID: <b7c038a6d2f8484e348ad977565ae9e6@208suo.com>
Date: Tue, 11 Jul 2023 10:38:42 +0800
From: sunran001@...suo.com
To: airlied@...il.com, daniel@...ll.ch
Cc: dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] drm/nouveau/volt: Move assignment outside if condition
Fixes the following checkpatch errors:
ERROR: do not use assignment in if condition
Signed-off-by: Ran Sun <sunran001@...suo.com>
---
drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
index a17a6dd8d3de..d1ae98a42e34 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/base.c
@@ -321,7 +321,8 @@ int
nvkm_volt_new_(const struct nvkm_volt_func *func, struct nvkm_device
*device,
enum nvkm_subdev_type type, int inst, struct nvkm_volt
**pvolt)
{
- if (!(*pvolt = kzalloc(sizeof(**pvolt), GFP_KERNEL)))
+ *pvolt = kzalloc(sizeof(**pvolt), GFP_KERNEL);
+ if (!*pvolt)
return -ENOMEM;
nvkm_volt_ctor(func, device, type, inst, *pvolt);
return 0;
Powered by blists - more mailing lists