diff options
author | Hans de Goede <hdegoede@redhat.com> | 2022-06-15 23:50:23 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-07-08 18:22:57 +0300 |
commit | 90612317325bb0b39c999e3a6f9da69597c5016f (patch) | |
tree | 152e81b38018066de29db92ea662fe782b77166a /drivers/staging/media/atomisp/pci/hmm | |
parent | 9f40d3a79dd69b9d7a684db2cad0217a456de372 (diff) | |
download | linux-90612317325bb0b39c999e3a6f9da69597c5016f.tar.xz |
media: atomisp: drop unused ATOMISP_MAP_FLAG_* flags
Drop the ATOMISP_MAP_FLAG_CACHED flag, it is never set anywhere;
also drop the matching "cached" parameter to hmm[_bo]_alloc which
value was derived form the never set flag.
Drop the ATOMISP_MAP_FLAG_NOFLUSH, it is not used anywhere.
Link: https://lore.kernel.org/linux-media/20220615205037.16549-27-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/hmm')
-rw-r--r-- | drivers/staging/media/atomisp/pci/hmm/hmm.c | 7 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 31 |
2 files changed, 17 insertions, 21 deletions
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm.c b/drivers/staging/media/atomisp/pci/hmm/hmm.c index de708495db04..82b46aaca00f 100644 --- a/drivers/staging/media/atomisp/pci/hmm/hmm.c +++ b/drivers/staging/media/atomisp/pci/hmm/hmm.c @@ -174,7 +174,6 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type, { unsigned int pgnr; struct hmm_buffer_object *bo; - bool cached = attrs & ATOMISP_MAP_FLAG_CACHED; int ret; /* @@ -195,7 +194,7 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type, } /* Allocate pages for memory */ - ret = hmm_bo_alloc_pages(bo, type, from_highmem, userptr, cached); + ret = hmm_bo_alloc_pages(bo, type, from_highmem, userptr); if (ret) { dev_err(atomisp_dev, "hmm_bo_alloc_pages failed.\n"); goto alloc_page_err; @@ -209,8 +208,8 @@ ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type, } dev_dbg(atomisp_dev, - "%s: pages: 0x%08x (%zu bytes), type: %d from highmem %d, user ptr %p, cached %d\n", - __func__, bo->start, bytes, type, from_highmem, userptr, cached); + "%s: pages: 0x%08x (%zu bytes), type: %d from highmem %d, user ptr %p\n", + __func__, bo->start, bytes, type, from_highmem, userptr); return bo->start; diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c index 72124a38c756..357f34fb7aef 100644 --- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c +++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c @@ -651,8 +651,7 @@ static void free_private_bo_pages(struct hmm_buffer_object *bo, /*Allocate pages which will be used only by ISP*/ static int alloc_private_pages(struct hmm_buffer_object *bo, - int from_highmem, - bool cached) + int from_highmem) { int ret; unsigned int pgnr, order, blk_pgnr, alloc_pgnr; @@ -730,19 +729,17 @@ retry: } else { blk_pgnr = order_to_nr(order); - if (!cached) { - /* - * set memory to uncacheable -- UC_MINUS - */ - ret = set_pages_uc(pages, blk_pgnr); - if (ret) { - dev_err(atomisp_dev, - "set page uncacheablefailed.\n"); + /* + * set memory to uncacheable -- UC_MINUS + */ + ret = set_pages_uc(pages, blk_pgnr); + if (ret) { + dev_err(atomisp_dev, + "set page uncacheablefailed.\n"); - __free_pages(pages, order); + __free_pages(pages, order); - goto cleanup; - } + goto cleanup; } for (j = 0; j < blk_pgnr; j++, i++) { @@ -797,7 +794,7 @@ static void free_user_pages(struct hmm_buffer_object *bo, * Convert user space virtual address into pages list */ static int alloc_user_pages(struct hmm_buffer_object *bo, - const void __user *userptr, bool cached) + const void __user *userptr) { int page_nr; int i; @@ -895,7 +892,7 @@ out_of_mem: */ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, enum hmm_bo_type type, int from_highmem, - const void __user *userptr, bool cached) + const void __user *userptr) { int ret = -EINVAL; @@ -909,9 +906,9 @@ int hmm_bo_alloc_pages(struct hmm_buffer_object *bo, * add HMM_BO_USER type */ if (type == HMM_BO_PRIVATE) { - ret = alloc_private_pages(bo, from_highmem, cached); + ret = alloc_private_pages(bo, from_highmem); } else if (type == HMM_BO_USER) { - ret = alloc_user_pages(bo, userptr, cached); + ret = alloc_user_pages(bo, userptr); } else { dev_err(atomisp_dev, "invalid buffer type.\n"); ret = -EINVAL; |