Patchwork [31/39] memory: cpu_physical_memory_set_dirty_tracking() should return void

login
register
mail settings
Submitter Juan Quintela
Date Nov. 6, 2013, 1:04 p.m.
Message ID <1383743088-8139-32-git-send-email-quintela@redhat.com>
Download mbox | patch
Permalink /patch/288899/
State New
Headers show

Comments

Juan Quintela - Nov. 6, 2013, 1:04 p.m.
Result was always 0, and not used anywhere.  Once there, use bool type
for the parameter.

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 exec.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
Eric Blake - Nov. 6, 2013, 11:55 p.m.
On 11/06/2013 06:04 AM, Juan Quintela wrote:
> Result was always 0, and not used anywhere.  Once there, use bool type
> for the parameter.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  exec.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

For 28-31,
Reviewed-by: Eric Blake <eblake@redhat.com>

Patch

diff --git a/exec.c b/exec.c
index 984b417..11b434b 100644
--- a/exec.c
+++ b/exec.c
@@ -54,7 +54,7 @@ 
 //#define DEBUG_SUBPAGE

 #if !defined(CONFIG_USER_ONLY)
-static int in_migration;
+static bool in_migration;

 RAMList ram_list = { .blocks = QTAILQ_HEAD_INITIALIZER(ram_list.blocks) };

@@ -676,11 +676,9 @@  void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t length,
     }
 }

-static int cpu_physical_memory_set_dirty_tracking(int enable)
+static void cpu_physical_memory_set_dirty_tracking(bool enable)
 {
-    int ret = 0;
     in_migration = enable;
-    return ret;
 }

 hwaddr memory_region_section_get_iotlb(CPUArchState *env,
@@ -1699,12 +1697,12 @@  static void tcg_commit(MemoryListener *listener)

 static void core_log_global_start(MemoryListener *listener)
 {
-    cpu_physical_memory_set_dirty_tracking(1);
+    cpu_physical_memory_set_dirty_tracking(true);
 }

 static void core_log_global_stop(MemoryListener *listener)
 {
-    cpu_physical_memory_set_dirty_tracking(0);
+    cpu_physical_memory_set_dirty_tracking(false);
 }

 static MemoryListener core_memory_listener = {