qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration/ram: Fix compilation with -Wshadow=local
@ 2023-10-23 14:50 Thomas Huth
  2023-10-23 15:27 ` Markus Armbruster
  2023-10-23 15:57 ` Peter Xu
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Huth @ 2023-10-23 14:50 UTC (permalink / raw)
  To: qemu-devel, Juan Quintela, Peter Xu, Fabiano Rosas
  Cc: Leonardo Bras, Markus Armbruster

No need for a new variable here, especially not for one that shadows
a variable from the beginning of the function scope. With this change
the code now successfully compiles with -Wshadow=local.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 migration/ram.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index 92769902bb..9de9e54fa9 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3238,8 +3238,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
 
         ram_flush_compressed_data(rs);
 
-        int ret = rdma_registration_stop(f, RAM_CONTROL_FINISH);
-        if (ret < 0) {
+        if (rdma_registration_stop(f, RAM_CONTROL_FINISH) < 0) {
             qemu_file_set_error(f, ret);
         }
     }
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-10-24 13:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-23 14:50 [PATCH] migration/ram: Fix compilation with -Wshadow=local Thomas Huth
2023-10-23 15:27 ` Markus Armbruster
2023-10-24  4:55   ` Markus Armbruster
2023-10-23 15:57 ` Peter Xu
2023-10-23 17:11   ` Thomas Huth
2023-10-23 17:30     ` ram_save_complete() is fishy (was: Re: [PATCH] migration/ram: Fix compilation with -Wshadow=local) Thomas Huth
2023-10-23 18:55       ` Peter Xu
2023-10-24  9:05         ` ram_save_complete() is fishy Thomas Huth
2023-10-24 13:12           ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).