From: Avihai Horon Date: Sun, 31 Dec 2023 09:30:11 +0000 (+0200) Subject: migration/multifd: Simplify multifd_channel_connect() if else statement X-Git-Tag: v9.0.0-rc0~124^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4395f5d3c06472ed70d9ef9f79878f95575be9e;p=thirdparty%2Fqemu.git migration/multifd: Simplify multifd_channel_connect() if else statement 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 Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/r/20231231093016.14204-7-avihaih@nvidia.com Signed-off-by: Peter Xu --- diff --git a/migration/multifd.c b/migration/multifd.c index a6204fc72f4..55d5fd55f82 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; }