[PATCH v2 19/20] qemu-file: Simplify qemu_file_shutdown()

Juan Quintela posted 20 patches 2 years, 8 months ago
[PATCH v2 19/20] qemu-file: Simplify qemu_file_shutdown()
Posted by Juan Quintela 2 years, 8 months ago
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/qemu-file.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index 01616d159c..e4923ab3a0 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -62,8 +62,6 @@ struct QEMUFile {
  */
 int qemu_file_shutdown(QEMUFile *f)
 {
-    int ret = 0;
-
     /*
      * We must set qemufile error before the real shutdown(), otherwise
      * there can be a race window where we thought IO all went though
@@ -93,10 +91,10 @@ int qemu_file_shutdown(QEMUFile *f)
     }
 
     if (qio_channel_shutdown(f->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL) < 0) {
-        ret = -EIO;
+        return -EIO;
     }
 
-    return ret;
+    return 0;
 }
 
 static QEMUFile *qemu_file_new_impl(QIOChannel *ioc, bool is_writable)
-- 
2.40.1
Re: [PATCH v2 19/20] qemu-file: Simplify qemu_file_shutdown()
Posted by Peter Xu 2 years, 7 months ago
On Tue, May 30, 2023 at 08:39:40PM +0200, Juan Quintela wrote:
> Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Peter Xu <peterx@redhat.com>

-- 
Peter Xu