diff mbox series

[06/11] migration/multifd: Simplify multifd_channel_connect() if else statement

Message ID 20231231093016.14204-7-avihaih@nvidia.com (mailing list archive)
State New, archived
Headers show
Series migration: Misc cleanups and fixes | expand

Commit Message

Avihai Horon Dec. 31, 2023, 9:30 a.m. UTC
The else branch in multifd_channel_connect() is redundant because when
the if branch is taken the function returns.

Simplify the code by removing the else branch.

Signed-off-by: Avihai Horon <avihaih@nvidia.com>
---
 migration/multifd.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Philippe Mathieu-Daudé Jan. 2, 2024, 10:03 a.m. UTC | #1
On 31/12/23 10:30, Avihai Horon wrote:
> The else branch in multifd_channel_connect() is redundant because when
> the if branch is taken the function returns.
> 
> Simplify the code by removing the else branch.
> 
> Signed-off-by: Avihai Horon <avihaih@nvidia.com>
> ---
>   migration/multifd.c | 13 ++++++-------
>   1 file changed, 6 insertions(+), 7 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/migration/multifd.c b/migration/multifd.c
index a6204fc72f..55d5fd55f8 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -847,14 +847,13 @@  static bool multifd_channel_connect(MultiFDSendParams *p,
          * so we mustn't call multifd_send_thread until then
          */
         return multifd_tls_channel_connect(p, ioc, errp);
-
-    } else {
-        migration_ioc_register_yank(ioc);
-        p->registered_yank = true;
-        p->c = ioc;
-        qemu_thread_create(&p->thread, p->name, multifd_send_thread, p,
-                           QEMU_THREAD_JOINABLE);
     }
+
+    migration_ioc_register_yank(ioc);
+    p->registered_yank = true;
+    p->c = ioc;
+    qemu_thread_create(&p->thread, p->name, multifd_send_thread, p,
+                       QEMU_THREAD_JOINABLE);
     return true;
 }