Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683493

Re: [PATCH 1/2] staging: media: atomisp2: css2400: Replace kfree()/vfree() with kvfree()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] staging: media: atomisp2: css2400: Replace kfree()/vfree() with kvfree()
Date 2017-07-08 03:00 +0200
Message-ID <u0Mgi-3ua-7@gated-at.bofh.it> (permalink)
References <u0M6B-3qm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 2017-07-07 at 20:40 -0400, Amitoj Kaur Chawla wrote:
> Conditionally calling kfree()/vfree() can be replaced by a call to 
> kvfree() which handles both kmalloced memory and vmalloced memory.
[]
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c
[]
> @@ -2029,10 +2029,7 @@ void *sh_css_calloc(size_t N, size_t size)
> 
>  void sh_css_free(void *ptr)
>  {
> -	if (is_vmalloc_addr(ptr))
> -		vfree(ptr);
> -	else
> -		kfree(ptr);
> +	kvfree(ptr);
>  }

Why not just get rid of sh_css_free and use kvfree directly?

Why not get rid of all the sh_css_<alloc/free> functions?

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] staging: media: atomisp2: css2400: Replace  kfree()/vfree() with kvfree() Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2017-07-08 02:50 +0200
  Re: [PATCH 1/2] staging: media: atomisp2: css2400: Replace  kfree()/vfree() with kvfree() Joe Perches <joe@perches.com> - 2017-07-08 03:00 +0200

csiph-web