[PATCH v2 10/13] migration/vmstate: Remove redundant statement in vmstate_save_state_v()

kuhn.chenqun@huawei.com posted 13 patches 5 years, 8 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Max Reitz <mreitz@redhat.com>, Ronnie Sahlberg <ronniesahlberg@gmail.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Andrzej Zaborowski <balrogg@gmail.com>, Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Peter Lieven <pl@kamp.de>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Igor Mitsyanko <i.mitsyanko@gmail.com>, Fam Zheng <fam@euphon.net>, Alistair Francis <alistair@alistair23.me>
There is a newer version of this series
[PATCH v2 10/13] migration/vmstate: Remove redundant statement in vmstate_save_state_v()
Posted by kuhn.chenqun@huawei.com 5 years, 8 months ago
From: Chen Qun <kuhn.chenqun@huawei.com>

The "ret" has been assigned in all branches. It didn't need to be
 assigned separately.

Clang static code analyzer show warning:
  migration/vmstate.c:365:17: warning: Value stored to 'ret' is never read
                ret = 0;
                ^     ~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
---
Cc: Juan Quintela <quintela@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
---
 migration/vmstate.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/migration/vmstate.c b/migration/vmstate.c
index 7dd8ef66c6..bafa890384 100644
--- a/migration/vmstate.c
+++ b/migration/vmstate.c
@@ -362,7 +362,6 @@ int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,
             }
             for (i = 0; i < n_elems; i++) {
                 void *curr_elem = first_elem + size * i;
-                ret = 0;
 
                 vmsd_desc_field_start(vmsd, vmdesc_loop, field, i, n_elems);
                 old_offset = qemu_ftell_fast(f);
-- 
2.23.0



Re: [PATCH v2 10/13] migration/vmstate: Remove redundant statement in vmstate_save_state_v()
Posted by Juan Quintela 5 years, 8 months ago
<kuhn.chenqun@huawei.com> wrote:
> From: Chen Qun <kuhn.chenqun@huawei.com>
>
> The "ret" has been assigned in all branches. It didn't need to be
>  assigned separately.
>
> Clang static code analyzer show warning:
>   migration/vmstate.c:365:17: warning: Value stored to 'ret' is never read
>                 ret = 0;
>                 ^     ~
>
> Reported-by: Euler Robot <euler.robot@huawei.com>
> Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>

I thought I had already reviewed it.

Reviewed-by: Juan Quintela <quintela@redhat.com>
queued