[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] migration/ram: Fix compilation with -Wshadow=local
|
From: |
Markus Armbruster |
|
Subject: |
Re: [PATCH] migration/ram: Fix compilation with -Wshadow=local |
|
Date: |
Mon, 23 Oct 2023 17:27:25 +0200 |
|
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Thomas Huth <thuth@redhat.com> writes:
> 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);
> }
> }
Reviewed-by: Markus Armbruster <armbru@redhat.com>
And queued. Thanks!