Re: [PATCH] drm: use kvfree instead of opencoding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 29.01.2015 11:36, Dave Airlie wrote:
> From: Dave Airlie <airlied@xxxxxxxxxx>
> 
> Al Viro added this to the mm finally, so instead
> of opencoding it use kvfree instead.
> 
> Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/nouveau/nouveau_gem.c | 5 +----
>  include/drm/drm_mem_util.h            | 5 +----
>  2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
> index 7c077fc..7270649 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
> @@ -552,10 +552,7 @@ nouveau_gem_pushbuf_validate(struct nouveau_channel *chan,
>  static inline void
>  u_free(void *addr)
>  {
> -	if (!is_vmalloc_addr(addr))
> -		kfree(addr);
> -	else
> -		vfree(addr);
> +	kvfree(addr);
>  }
>  
>  static inline void *
> diff --git a/include/drm/drm_mem_util.h b/include/drm/drm_mem_util.h
> index 19a2404..e42495a 100644
> --- a/include/drm/drm_mem_util.h
> +++ b/include/drm/drm_mem_util.h
> @@ -56,10 +56,7 @@ static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size)
>  
>  static __inline void drm_free_large(void *ptr)
>  {
> -	if (!is_vmalloc_addr(ptr))
> -		return kfree(ptr);
> -
> -	vfree(ptr);
> +	kvfree(ptr);
>  }
>  
>  #endif
> 

Any reason for keeping the u_free and drm_free_large wrappers?


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux