From: Nikolay Kulikov <nikolayof23@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans de Goede <hansg@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>
Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org,
Nikolay Kulikov <nikolayof23@gmail.com>
Subject: [PATCH 2/2] staging: media: atomisp: remove unused functions from hmm_bo.c
Date: Wed, 22 Jul 2026 00:42:33 +0300 [thread overview]
Message-ID: <20260721214238.840406-3-nikolayof23@gmail.com> (raw)
In-Reply-To: <20260721214238.840406-1-nikolayof23@gmail.com>
Remove several functions that are defined but never called.
Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
---
.../media/atomisp/include/hmm/hmm_bo.h | 19 ----
.../staging/media/atomisp/pci/hmm/hmm_bo.c | 97 -------------------
2 files changed, 116 deletions(-)
diff --git a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
index e09ac29ac43d..ba3c582a0f89 100644
--- a/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
+++ b/drivers/staging/media/atomisp/include/hmm/hmm_bo.h
@@ -205,7 +205,6 @@ int hmm_bo_page_allocated(struct hmm_buffer_object *bo);
*/
int hmm_bo_bind(struct hmm_buffer_object *bo);
void hmm_bo_unbind(struct hmm_buffer_object *bo);
-int hmm_bo_binded(struct hmm_buffer_object *bo);
/*
* vmap buffer object's pages to contiguous kernel virtual address.
@@ -224,17 +223,6 @@ void hmm_bo_flush_vmap(struct hmm_buffer_object *bo);
*/
void hmm_bo_vunmap(struct hmm_buffer_object *bo);
-/*
- * mmap the bo's physical pages to specific vma.
- *
- * vma's address space size must be the same as bo's size,
- * otherwise it will return -EINVAL.
- *
- * vma->vm_flags will be set to (VM_RESERVED | VM_IO).
- */
-int hmm_bo_mmap(struct vm_area_struct *vma,
- struct hmm_buffer_object *bo);
-
/*
* find the buffer object by its virtual address vaddr.
* return NULL if no such buffer object found.
@@ -251,11 +239,4 @@ struct hmm_buffer_object *hmm_bo_device_search_start(
struct hmm_buffer_object *hmm_bo_device_search_in_range(
struct hmm_bo_device *bdev, ia_css_ptr vaddr);
-/*
- * find the buffer object with kernel virtual address vaddr.
- * return NULL if no such buffer object found.
- */
-struct hmm_buffer_object *hmm_bo_device_search_vmap_start(
- struct hmm_bo_device *bdev, const void *vaddr);
-
#endif
diff --git a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
index 0a8f401a1ca1..837077f1d229 100644
--- a/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
+++ b/drivers/staging/media/atomisp/pci/hmm/hmm_bo.c
@@ -578,31 +578,6 @@ struct hmm_buffer_object *hmm_bo_device_search_in_range(
return bo;
}
-struct hmm_buffer_object *hmm_bo_device_search_vmap_start(
- struct hmm_bo_device *bdev, const void *vaddr)
-{
- struct list_head *pos;
- struct hmm_buffer_object *bo;
- unsigned long flags;
-
- check_bodev_null_return(bdev, NULL);
-
- spin_lock_irqsave(&bdev->list_lock, flags);
- list_for_each(pos, &bdev->entire_bo_list) {
- bo = list_to_hmm_bo(pos);
- /* pass bo which has no vm_node allocated */
- if ((bo->status & HMM_BO_MASK) == HMM_BO_FREE)
- continue;
- if (bo->vmap_addr == vaddr)
- goto found;
- }
- spin_unlock_irqrestore(&bdev->list_lock, flags);
- return NULL;
-found:
- spin_unlock_irqrestore(&bdev->list_lock, flags);
- return bo;
-}
-
static void free_pages_bulk_array(unsigned long nr_pages, struct page **page_array)
{
unsigned long i;
@@ -885,21 +860,6 @@ void hmm_bo_unbind(struct hmm_buffer_object *bo)
"buffer vm or page not allocated or not binded yet.\n");
}
-int hmm_bo_binded(struct hmm_buffer_object *bo)
-{
- int ret;
-
- check_bo_null_return(bo, 0);
-
- mutex_lock(&bo->mutex);
-
- ret = bo->status & HMM_BO_BINDED;
-
- mutex_unlock(&bo->mutex);
-
- return ret;
-}
-
void *hmm_bo_vmap(struct hmm_buffer_object *bo, bool cached)
{
check_bo_null_return(bo, NULL);
@@ -1023,60 +983,3 @@ static const struct vm_operations_struct hmm_bo_vm_ops = {
.open = hmm_bo_vm_open,
.close = hmm_bo_vm_close,
};
-
-/*
- * mmap the bo to user space.
- */
-int hmm_bo_mmap(struct vm_area_struct *vma, struct hmm_buffer_object *bo)
-{
- unsigned int start, end;
- unsigned int virt;
- unsigned int pgnr, i;
- unsigned int pfn;
-
- check_bo_null_return(bo, -EINVAL);
-
- check_bo_status_yes_goto(bo, HMM_BO_PAGE_ALLOCED, status_err);
-
- pgnr = bo->pgnr;
- start = vma->vm_start;
- end = vma->vm_end;
-
- /*
- * check vma's virtual address space size and buffer object's size.
- * must be the same.
- */
- if ((start + pgnr_to_size(pgnr)) != end) {
- dev_warn(atomisp_dev,
- "vma's address space size not equal to buffer object's size");
- return -EINVAL;
- }
-
- virt = vma->vm_start;
- for (i = 0; i < pgnr; i++) {
- pfn = page_to_pfn(bo->pages[i]);
- if (remap_pfn_range(vma, virt, pfn, PAGE_SIZE, PAGE_SHARED)) {
- dev_warn(atomisp_dev,
- "remap_pfn_range failed: virt = 0x%x, pfn = 0x%x, mapped_pgnr = %d\n",
- virt, pfn, 1);
- return -EINVAL;
- }
- virt += PAGE_SIZE;
- }
-
- vma->vm_private_data = bo;
-
- vma->vm_ops = &hmm_bo_vm_ops;
- vm_flags_set(vma, VM_IO | VM_DONTEXPAND | VM_DONTDUMP);
-
- /*
- * call hmm_bo_vm_open explicitly.
- */
- hmm_bo_vm_open(vma);
-
- return 0;
-
-status_err:
- dev_err(atomisp_dev, "buffer page not allocated yet.\n");
- return -EINVAL;
-}
--
2.55.0
next prev parent reply other threads:[~2026-07-21 21:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 21:42 [PATCH 0/2] staging: media: atomisp: remove unused functions Nikolay Kulikov
2026-07-21 21:42 ` [PATCH 1/2] staging: media: atomisp: remove unused functions from hmm.c Nikolay Kulikov
2026-07-21 21:42 ` Nikolay Kulikov [this message]
2026-07-22 4:58 ` [PATCH 0/2] staging: media: atomisp: remove unused functions Andy Shevchenko
2026-07-22 5:08 ` Andy Shevchenko
2026-07-23 5:36 ` Nikolay Kulikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260721214238.840406-3-nikolayof23@gmail.com \
--to=nikolayof23@gmail.com \
--cc=andy@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.