[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] migration/ram: Fix compilation with -Wshadow=local
|
From: |
Peter Xu |
|
Subject: |
Re: [PATCH] migration/ram: Fix compilation with -Wshadow=local |
|
Date: |
Mon, 23 Oct 2023 11:57:07 -0400 |
On Mon, Oct 23, 2023 at 04:50:44PM +0200, Thomas Huth wrote:
> 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) {
We may need to rename "ret" to something else? qemu_file_set_error(),
right below, will reference the error returned.
> qemu_file_set_error(f, ret); <-----------------
Thanks,
> }
> }
> --
> 2.41.0
>
--
Peter Xu