[PATCH v2 34/38] drm/vgem: remove _unlocked suffix in drm_object_put_unlocked

Daniel Vetter daniel at ffwll.ch
Fri May 15 14:26:37 UTC 2020


On Fri, May 15, 2020 at 10:51:14AM +0100, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> 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: David Airlie <airlied at linux.ie>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: Emil Velikov <emil.velikov at collabora.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> Acked-by: Sam Ravnborg <sam at ravnborg.org>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/vgem/vgem_drv.c   | 6 +++---
>  drivers/gpu/drm/vgem/vgem_fence.c | 2 +-
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
> index ec1a8ebb6f1b..e4dc7b267a0b 100644
> --- a/drivers/gpu/drm/vgem/vgem_drv.c
> +++ b/drivers/gpu/drm/vgem/vgem_drv.c
> @@ -198,7 +198,7 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev,
>  
>  	ret = drm_gem_handle_create(file, &obj->base, handle);
>  	if (ret) {
> -		drm_gem_object_put_unlocked(&obj->base);
> +		drm_gem_object_put(&obj->base);
>  		return ERR_PTR(ret);
>  	}
>  
> @@ -223,7 +223,7 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
>  	args->size = gem_object->size;
>  	args->pitch = pitch;
>  
> -	drm_gem_object_put_unlocked(gem_object);
> +	drm_gem_object_put(gem_object);
>  
>  	DRM_DEBUG("Created object of size %llu\n", args->size);
>  
> @@ -251,7 +251,7 @@ static int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev,
>  
>  	*offset = drm_vma_node_offset_addr(&obj->vma_node);
>  unref:
> -	drm_gem_object_put_unlocked(obj);
> +	drm_gem_object_put(obj);
>  
>  	return ret;
>  }
> diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
> index 9268f6fc3f66..17f32f550dd9 100644
> --- a/drivers/gpu/drm/vgem/vgem_fence.c
> +++ b/drivers/gpu/drm/vgem/vgem_fence.c
> @@ -182,7 +182,7 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
>  		dma_fence_put(fence);
>  	}
>  err:
> -	drm_gem_object_put_unlocked(obj);
> +	drm_gem_object_put(obj);
>  	return ret;
>  }
>  
> -- 
> 2.25.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list