[PATCH 01/13] block/stream: Remove redundant statement in stream_run()

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

Clang static code analyzer show warning:
  block/stream.c:186:9: 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: John Snow <jsnow@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: qemu-block@nongnu.org
---
 block/stream.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/stream.c b/block/stream.c
index 5562ccbf57..d78074ac80 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -183,7 +183,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
                 break;
             }
         }
-        ret = 0;
 
         /* Publish progress */
         job_progress_update(&s->common.job, n);
-- 
2.23.0



Re: [PATCH 01/13] block/stream: Remove redundant statement in stream_run()
Posted by John Snow 5 years, 8 months ago

On 2/24/20 9:09 PM, kuhn.chenqun@huawei.com wrote:
> From: Chen Qun <kuhn.chenqun@huawei.com>
> 
> Clang static code analyzer show warning:
>   block/stream.c:186:9: 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: John Snow <jsnow@redhat.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: qemu-block@nongnu.org
> ---
>  block/stream.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/block/stream.c b/block/stream.c
> index 5562ccbf57..d78074ac80 100644
> --- a/block/stream.c
> +++ b/block/stream.c
> @@ -183,7 +183,6 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
>                  break;
>              }
>          }
> -        ret = 0;
>  
>          /* Publish progress */
>          job_progress_update(&s->common.job, n);
> 

Reviewed-by: John Snow <jsnow@redhat.com>