lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5e8eabb592aaf355e6a29aea1f71a551@208suo.com>
Date:   Tue, 11 Jul 2023 14:59:04 +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: 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/nouveau_usif.c | 12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_usif.c 
b/drivers/gpu/drm/nouveau/nouveau_usif.c
index 002d1479ba89..d0b555630a6f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_usif.c
+++ b/drivers/gpu/drm/nouveau/nouveau_usif.c
@@ -57,7 +57,8 @@ usif_object_new(struct drm_file *f, void *data, u32 
size, void *argv, u32 argc,
      struct usif_object *object;
      int ret = -ENOSYS;

-    if ((ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true)))
+    ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, true);
+    if (ret)
          return ret;

      switch (args->v0.oclass) {
@@ -70,7 +71,8 @@ usif_object_new(struct drm_file *f, void *data, u32 
size, void *argv, u32 argc,
              struct nv_device_v0 v0;
          } *args = data;

-        if ((ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, 
false)))
+        ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, false);
+        if (ret)
              return ret;

          args->v0.priv = false;
@@ -82,7 +84,8 @@ usif_object_new(struct drm_file *f, void *data, u32 
size, void *argv, u32 argc,
          break;
      }

-    if (!(object = kmalloc(sizeof(*object), GFP_KERNEL)))
+    object = kmalloc(sizeof(*object), GFP_KERNEL);
+    if (!object)
          return -ENOMEM;
      list_add(&object->head, &cli->objects);

@@ -121,7 +124,8 @@ usif_ioctl(struct drm_file *filp, void __user *user, 
u32 argc)
      if (ret = -EFAULT, copy_from_user(argv, user, size))
          goto done;

-    if (!(ret = nvif_unpack(-ENOSYS, &data, &size, argv->v0, 0, 0, 
true))) {
+    ret = nvif_unpack(-ENOSYS, &data, &size, argv->v0, 0, 0, true);
+    if (!ret) {
          /* block access to objects not created via this interface */
          owner = argv->v0.owner;
          if (argv->v0.object == 0ULL &&

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ