diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-05-27 14:23:31 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 18:15:10 +0200 |
commit | 9955d906f28098dfb7be9b5c75006c5f2b431772 (patch) | |
tree | 757eb1456c688a2852244a90c3854facd89641de /drivers/staging/media/atomisp/pci/sh_css.c | |
parent | 591e6a0aad547b37123274a290ab6e172bc8be9d (diff) | |
download | linux-9955d906f28098dfb7be9b5c75006c5f2b431772.tar.bz2 |
media: atomisp: remove kvmalloc/kvcalloc abstractions
The sh_css layer adds an abstraction for kvmalloc/kvcalloc.
Get rid of them. Most of the work here was done by this
small coccinelle script:
<cocci>
@@
expression size;
@@
- sh_css_malloc(size)
+ kvmalloc(size, GFP_KERNEL)
@@
expression n;
expression size;
@@
- sh_css_calloc(n, size)
+ kvcalloc(n, size, GFP_KERNEL)
</cocci>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/sh_css.c')
-rw-r--r-- | drivers/staging/media/atomisp/pci/sh_css.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 4860f768349e..de504cb4e546 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -1862,35 +1862,6 @@ ia_css_enable_isys_event_queue(bool enable) { return IA_CSS_SUCCESS; } -void *sh_css_malloc(size_t size) -{ - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, "sh_css_malloc() enter: size=%zu\n", - size); - /* FIXME: This first test can probably go away */ - if (size == 0) - return NULL; - if (size > PAGE_SIZE) - return vmalloc(size); - return kmalloc(size, GFP_KERNEL); -} - -void *sh_css_calloc(size_t N, size_t size) -{ - void *p; - - ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, - "sh_css_calloc() enter: N=%zu, size=%zu\n", N, size); - - /* FIXME: this test can probably go away */ - if (size > 0) { - p = sh_css_malloc(N * size); - if (p) - memset(p, 0, size); - return p; - } - return NULL; -} - void sh_css_free(void *ptr) { if (is_vmalloc_addr(ptr)) @@ -9035,7 +9006,7 @@ ia_css_pipe_create_extra(const struct ia_css_pipe_config *config, i); if (err != IA_CSS_SUCCESS) { IA_CSS_LEAVE_ERR_PRIVATE(err); - sh_css_free(internal_pipe); + kvfree(internal_pipe); internal_pipe = NULL; return err; } @@ -9054,7 +9025,7 @@ ia_css_pipe_create_extra(const struct ia_css_pipe_config *config, i); if (err != IA_CSS_SUCCESS) { IA_CSS_LEAVE_ERR_PRIVATE(err); - sh_css_free(internal_pipe); + kvfree(internal_pipe); internal_pipe = NULL; return err; } @@ -9066,7 +9037,7 @@ ia_css_pipe_create_extra(const struct ia_css_pipe_config *config, internal_pipe->config.acc_extension); if (err != IA_CSS_SUCCESS) { IA_CSS_LEAVE_ERR_PRIVATE(err); - sh_css_free(internal_pipe); + kvfree(internal_pipe); return err; } } |