mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau/volt: Move assignment outside if condition
       [not found] <20230711023631.78374-1-xujianghui@cdjrlc.com>
@ 2023-07-11  2:38 ` sunran001
  0 siblings, 0 replies; only message in thread
From: sunran001 @ 2023-07-11  2:38 UTC (permalink / raw)
  To: airlied, daniel; +Cc: dri-devel, nouveau, linux-kernel

Fixes the following checkpatch errors:

ERROR: do not use assignment in if condition

Signed-off-by: Ran Sun <sunran001@208suo.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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-11  2:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230711023631.78374-1-xujianghui@cdjrlc.com>
2023-07-11  2:38 ` [PATCH] drm/nouveau/volt: Move assignment outside if condition sunran001

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®