drm/nouveau: Move assignment outside if condition
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 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 <[email protected]>
--- drivers/gpu/drm/nouveau/nouveau_usif.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_usif.c +8 -4
@@ -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 &&