qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/3] memory: Extract mtree_info_as() from mtree_info()


From: Richard Henderson
Subject: Re: [PATCH v4 2/3] memory: Extract mtree_info_as() from mtree_info()
Date: Sat, 4 Sep 2021 11:23:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 9/1/21 7:11 PM, David Hildenbrand wrote:
On 01.09.21 18:19, Philippe Mathieu-Daudé wrote:
While mtree_info() handles both ASes and flatviews cases,
the two cases share basically no code. Split mtree_info_as()
out of mtree_info() to simplify.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
  softmmu/memory.c | 17 ++++++++++-------
  1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index 3eb6f52de67..5be7d5e7412 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -3284,18 +3284,12 @@ static void mtree_info_flatview(bool dispatch_tree, 
bool owner)
      g_hash_table_unref(views);
  }
-void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled)
+static void mtree_info_as(bool dispatch_tree, bool owner, bool disabled)
  {
      MemoryRegionListHead ml_head;
      MemoryRegionList *ml, *ml2;
      AddressSpace *as;
-    if (flatview) {
-        mtree_info_flatview(dispatch_tree, owner);
-
-        return;
-    }
-
      QTAILQ_INIT(&ml_head);
      QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
@@ -3316,6 +3310,15 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled)
      }
  }
+void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled)
+{
+    if (flatview) {
+        mtree_info_flatview(dispatch_tree, owner);
+    } else {
+        mtree_info_as(dispatch_tree, owner, disabled);
+    }
+}
+
  void memory_region_init_ram(MemoryRegion *mr,
                              Object *owner,
                              const char *name,


Reviewed-by: David Hildenbrand <david@redhat.com>

I'd just have squashed that into #1.

Agreed, it seems like all part of one change.  Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]