summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2023-06-13 16:57:52 +0200
committerJuan Quintela <quintela@redhat.com>2023-10-17 22:14:51 +0200
commit4703d1958ca149b3baa8df73945c5ddfc9808e73 (patch)
tree1a996dc97dd79fb3d8e3b52567b391d6b8a1c57c
parent1fd03d41b86daa1eb8c941dfa013cc806bcaf053 (diff)
downloadfocaccia-qemu-4703d1958ca149b3baa8df73945c5ddfc9808e73.tar.gz
focaccia-qemu-4703d1958ca149b3baa8df73945c5ddfc9808e73.zip
migration: Simplify decompress_data_with_multi_threads()
Doing a break to do another break is just confused.  Just call return
when we know we want to return.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Message-ID: <20230613145757.10131-14-quintela@redhat.com>
-rw-r--r--migration/ram-compress.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/migration/ram-compress.c b/migration/ram-compress.c
index 3ad5975d48..95a8d6b906 100644
--- a/migration/ram-compress.c
+++ b/migration/ram-compress.c
@@ -481,14 +481,10 @@ void decompress_data_with_multi_threads(QEMUFile *f, void *host, int len)
                 decomp_param[idx].len = len;
                 qemu_cond_signal(&decomp_param[idx].cond);
                 qemu_mutex_unlock(&decomp_param[idx].mutex);
-                break;
+                return;
             }
         }
-        if (idx < thread_count) {
-            break;
-        } else {
-            qemu_cond_wait(&decomp_done_cond, &decomp_done_lock);
-        }
+        qemu_cond_wait(&decomp_done_cond, &decomp_done_lock);
     }
 }