* [PATCH] util/iova-tree: Remove deadcode
@ 2024-09-18 14:25 dave
2024-09-18 16:41 ` Peter Xu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: dave @ 2024-09-18 14:25 UTC (permalink / raw)
To: peterx; +Cc: qemu-devel, Dr. David Alan Gilbert
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>
---
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.46.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] util/iova-tree: Remove deadcode
2024-09-18 14:25 [PATCH] util/iova-tree: Remove deadcode dave
@ 2024-09-18 16:41 ` Peter Xu
2024-10-02 10:31 ` Thomas Huth
2024-10-02 14:34 ` Peter Xu
2 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2024-09-18 16:41 UTC (permalink / raw)
To: dave, Michael S. Tsirkin, Jason Wang; +Cc: qemu-devel
On Wed, Sep 18, 2024 at 03:25:15PM +0100, dave@treblig.org wrote:
> 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>
Michael, Jason,
It seems iova now has its own entry in MAINTAINERS, however this is
currently used either by VT-d or vhost. Maybe it makes more sense that you
maintain this small file together with vt-d/vhost (considering I dropped
myself from VT-d development)?
Please feel free to pick up this patch if you want, or let me know if you
want me to do that.
PS: if you agree on above, I can move on with a MAINTAINERS file change to
drop myself from IOVA tree maintainers, then I'll add both of you in, if
that sounds good to you.
Thanks!
> ---
> 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.46.0
>
--
Peter Xu
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] util/iova-tree: Remove deadcode
2024-09-18 14:25 [PATCH] util/iova-tree: Remove deadcode dave
2024-09-18 16:41 ` Peter Xu
@ 2024-10-02 10:31 ` Thomas Huth
2024-10-02 14:34 ` Peter Xu
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2024-10-02 10:31 UTC (permalink / raw)
To: dave, peterx, QEMU Trivial; +Cc: qemu-devel
On 18/09/2024 16.25, dave@treblig.org wrote:
> 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>
> ---
> 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;
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] util/iova-tree: Remove deadcode
2024-09-18 14:25 [PATCH] util/iova-tree: Remove deadcode dave
2024-09-18 16:41 ` Peter Xu
2024-10-02 10:31 ` Thomas Huth
@ 2024-10-02 14:34 ` Peter Xu
2 siblings, 0 replies; 4+ messages in thread
From: Peter Xu @ 2024-10-02 14:34 UTC (permalink / raw)
To: dave; +Cc: qemu-devel
On Wed, Sep 18, 2024 at 03:25:15PM +0100, dave@treblig.org wrote:
> 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>
queued.
--
Peter Xu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-02 14:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 14:25 [PATCH] util/iova-tree: Remove deadcode dave
2024-09-18 16:41 ` Peter Xu
2024-10-02 10:31 ` Thomas Huth
2024-10-02 14:34 ` Peter Xu
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).