drm/vc4: remove _unlocked suffix in drm_gem_object_put_unlocked
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 15 May 2020 09:51:13 +0000 (10:51 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 May 2020 21:31:35 +0000 (22:31 +0100)
Spelling out _unlocked for each and every driver is a annoying.
Especially if we consider how many drivers, do not know (or need to)
about the horror stories involving struct_mutex.

Just drop the suffix. It makes the API cleaner.

Done via the following script:

__from=drm_gem_object_put_unlocked
__to=drm_gem_object_put
for __file in $(git grep --name-only $__from); do
  sed -i  "s/$__from/$__to/g" $__file;
done

Cc: Eric Anholt <eric@anholt.net>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515095118.2743122-34-emil.l.velikov@gmail.com
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_gem.c
drivers/gpu/drm/vc4/vc4_kms.c
drivers/gpu/drm/vc4/vc4_v3d.c

index 72d30d9..74ceebd 100644 (file)
@@ -490,7 +490,7 @@ int vc4_dumb_create(struct drm_file *file_priv,
        bo->madv = VC4_MADV_WILLNEED;
 
        ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
-       drm_gem_object_put_unlocked(&bo->base.base);
+       drm_gem_object_put(&bo->base.base);
 
        return ret;
 }
@@ -834,7 +834,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data,
        bo->madv = VC4_MADV_WILLNEED;
 
        ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
-       drm_gem_object_put_unlocked(&bo->base.base);
+       drm_gem_object_put(&bo->base.base);
 
        return ret;
 }
@@ -854,7 +854,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data,
        /* The mmap offset was set up at BO allocation time. */
        args->offset = drm_vma_node_offset_addr(&gem_obj->vma_node);
 
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
        return 0;
 }
 
@@ -918,7 +918,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data,
        ret = drm_gem_handle_create(file_priv, &bo->base.base, &args->handle);
 
 fail:
-       drm_gem_object_put_unlocked(&bo->base.base);
+       drm_gem_object_put(&bo->base.base);
 
        return ret;
 }
@@ -965,7 +965,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data,
        bo = to_vc4_bo(gem_obj);
        bo->t_format = t_format;
 
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
 
        return 0;
 }
@@ -1000,7 +1000,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data,
        else
                args->modifier = DRM_FORMAT_MOD_NONE;
 
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
 
        return 0;
 }
@@ -1091,7 +1091,7 @@ int vc4_label_bo_ioctl(struct drm_device *dev, void *data,
                ret = -ENOMEM;
        mutex_unlock(&vc4->bo_lock);
 
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
 
        return ret;
 }
index e1cfc3c..9f01ddd 100644 (file)
@@ -58,7 +58,7 @@ vc4_free_hang_state(struct drm_device *dev, struct vc4_hang_state *state)
        unsigned int i;
 
        for (i = 0; i < state->user_state.bo_count; i++)
-               drm_gem_object_put_unlocked(state->bo[i]);
+               drm_gem_object_put(state->bo[i]);
 
        kfree(state);
 }
@@ -808,7 +808,7 @@ fail_dec_usecnt:
 fail_put_bo:
        /* Release any reference to acquired objects. */
        for (i = 0; i < exec->bo_count && exec->bo[i]; i++)
-               drm_gem_object_put_unlocked(&exec->bo[i]->base);
+               drm_gem_object_put(&exec->bo[i]->base);
 
 fail:
        kvfree(handles);
@@ -957,7 +957,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
                        struct vc4_bo *bo = to_vc4_bo(&exec->bo[i]->base);
 
                        vc4_bo_dec_usecnt(bo);
-                       drm_gem_object_put_unlocked(&exec->bo[i]->base);
+                       drm_gem_object_put(&exec->bo[i]->base);
                }
                kvfree(exec->bo);
        }
@@ -966,7 +966,7 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec)
                struct vc4_bo *bo = list_first_entry(&exec->unref_list,
                                                     struct vc4_bo, unref_head);
                list_del(&bo->unref_head);
-               drm_gem_object_put_unlocked(&bo->base.base);
+               drm_gem_object_put(&bo->base.base);
        }
 
        /* Free up the allocation of any bin slots we used. */
@@ -1107,7 +1107,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data,
        ret = vc4_wait_for_seqno_ioctl_helper(dev, bo->seqno,
                                              &args->timeout_ns);
 
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
        return ret;
 }
 
@@ -1301,7 +1301,7 @@ vc4_gem_destroy(struct drm_device *dev)
         * the overflow allocation registers.  Now free the object.
         */
        if (vc4->bin_bo) {
-               drm_gem_object_put_unlocked(&vc4->bin_bo->base.base);
+               drm_gem_object_put(&vc4->bin_bo->base.base);
                vc4->bin_bo = NULL;
        }
 
@@ -1382,7 +1382,7 @@ int vc4_gem_madvise_ioctl(struct drm_device *dev, void *data,
        ret = 0;
 
 out_put_gem:
-       drm_gem_object_put_unlocked(gem_obj);
+       drm_gem_object_put(gem_obj);
 
        return ret;
 }
index 78d4fb0..08318e6 100644 (file)
@@ -330,7 +330,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev,
                        mode_cmd_local.modifier[0] = DRM_FORMAT_MOD_NONE;
                }
 
-               drm_gem_object_put_unlocked(gem_obj);
+               drm_gem_object_put(gem_obj);
 
                mode_cmd = &mode_cmd_local;
        }
index cea77a2..f7ab979 100644 (file)
@@ -308,7 +308,7 @@ static int bin_bo_alloc(struct vc4_dev *vc4)
                                                    struct vc4_bo, unref_head);
 
                list_del(&bo->unref_head);
-               drm_gem_object_put_unlocked(&bo->base.base);
+               drm_gem_object_put(&bo->base.base);
        }
 
        return ret;
@@ -344,7 +344,7 @@ static void bin_bo_release(struct kref *ref)
        if (WARN_ON_ONCE(!vc4->bin_bo))
                return;
 
-       drm_gem_object_put_unlocked(&vc4->bin_bo->base.base);
+       drm_gem_object_put(&vc4->bin_bo->base.base);
        vc4->bin_bo = NULL;
 }