qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Fabiano Rosas <farosas@suse.de>,
	peterx@redhat.com, "Dr. David Alan Gilbert" <dave@treblig.org>,
	Thomas Huth <thuth@redhat.com>
Subject: [PULL 11/12] util/iova-tree: Remove deadcode
Date: Wed,  9 Oct 2024 08:42:37 -0400	[thread overview]
Message-ID: <20241009124238.371084-12-peterx@redhat.com> (raw)
In-Reply-To: <20241009124238.371084-1-peterx@redhat.com>

From: "Dr. David Alan Gilbert" <dave@treblig.org>

iova_tree_find_address, and iova_tree_foreach have never been
used since the code was originally added by:
  eecf5eedbd ("util: implement simple iova tree")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Link: https://lore.kernel.org/r/20240918142515.153074-1-dave@treblig.org
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 include/qemu/iova-tree.h | 25 -------------------------
 util/iova-tree.c         | 23 -----------------------
 2 files changed, 48 deletions(-)

diff --git a/include/qemu/iova-tree.h b/include/qemu/iova-tree.h
index 2a10a7052e..44a45931d5 100644
--- a/include/qemu/iova-tree.h
+++ b/include/qemu/iova-tree.h
@@ -111,31 +111,6 @@ const DMAMap *iova_tree_find(const IOVATree *tree, const DMAMap *map);
  */
 const DMAMap *iova_tree_find_iova(const IOVATree *tree, const DMAMap *map);
 
-/**
- * iova_tree_find_address:
- *
- * @tree: the iova tree to search from
- * @iova: the iova address to find
- *
- * Similar to iova_tree_find(), but it tries to find mapping with
- * range iova=iova & size=0.
- *
- * Return: same as iova_tree_find().
- */
-const DMAMap *iova_tree_find_address(const IOVATree *tree, hwaddr iova);
-
-/**
- * iova_tree_foreach:
- *
- * @tree: the iova tree to iterate on
- * @iterator: the iterator for the mappings, return true to stop
- *
- * Iterate over the iova tree.
- *
- * Return: 1 if found any overlap, 0 if not, <0 if error.
- */
-void iova_tree_foreach(IOVATree *tree, iova_tree_iterator iterator);
-
 /**
  * iova_tree_alloc_map:
  *
diff --git a/util/iova-tree.c b/util/iova-tree.c
index 536789797e..06295e2755 100644
--- a/util/iova-tree.c
+++ b/util/iova-tree.c
@@ -115,13 +115,6 @@ const DMAMap *iova_tree_find_iova(const IOVATree *tree, const DMAMap *map)
     return args.result;
 }
 
-const DMAMap *iova_tree_find_address(const IOVATree *tree, hwaddr iova)
-{
-    const DMAMap map = { .iova = iova, .size = 0 };
-
-    return iova_tree_find(tree, &map);
-}
-
 static inline void iova_tree_insert_internal(GTree *gtree, DMAMap *range)
 {
     /* Key and value are sharing the same range data */
@@ -148,22 +141,6 @@ int iova_tree_insert(IOVATree *tree, const DMAMap *map)
     return IOVA_OK;
 }
 
-static gboolean iova_tree_traverse(gpointer key, gpointer value,
-                                gpointer data)
-{
-    iova_tree_iterator iterator = data;
-    DMAMap *map = key;
-
-    g_assert(key == value);
-
-    return iterator(map);
-}
-
-void iova_tree_foreach(IOVATree *tree, iova_tree_iterator iterator)
-{
-    g_tree_foreach(tree->tree, iova_tree_traverse, iterator);
-}
-
 void iova_tree_remove(IOVATree *tree, DMAMap map)
 {
     const DMAMap *overlap;
-- 
2.45.0



  parent reply	other threads:[~2024-10-09 12:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 12:42 [PULL 00/12] Migration 20241009 patches Peter Xu
2024-10-09 12:42 ` [PULL 01/12] memory: notify hypervisor of all eventfds during listener (de)registration Peter Xu
2024-10-09 12:42 ` [PULL 02/12] migration/multifd: Ensure packet->ramblock is null-terminated Peter Xu
2024-10-09 12:42 ` [PULL 03/12] migration: Remove migrate_cap_set Peter Xu
2024-10-09 12:42 ` [PULL 04/12] migration: Remove unused migrate_zero_blocks Peter Xu
2024-10-09 12:42 ` [PULL 05/12] migration: Deprecate zero-blocks capability Peter Xu
2024-10-09 12:42 ` [PULL 06/12] migration: Remove unused socket_send_channel_create_sync Peter Xu
2024-10-09 12:42 ` [PULL 07/12] util/userfaultfd: Return -errno on error Peter Xu
2024-10-09 12:42 ` [PULL 08/12] migration/postcopy: Use uffd helpers Peter Xu
2024-10-09 12:42 ` [PULL 09/12] util/userfaultfd: Remove unused uffd_poll_events Peter Xu
2024-10-09 12:42 ` [PULL 10/12] tests/migration-test: Wait for cancellation sooner in multifd cancel Peter Xu
2024-10-09 12:42 ` Peter Xu [this message]
2024-10-09 12:42 ` [PULL 12/12] migration/multifd: fix build error when qpl compression is enabled Peter Xu
2024-10-10 12:23 ` [PULL 00/12] Migration 20241009 patches Peter Maydell

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=20241009124238.371084-12-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=dave@treblig.org \
    --cc=farosas@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).