diff mbox series

[1/3] block/qcow2-bitmap: Remove unneeded variable assignment

Message ID 20200215161557.4077-2-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw: Remove unneeded variable assignment | expand

Commit Message

Philippe Mathieu-Daudé Feb. 15, 2020, 4:15 p.m. UTC
Fix warning reported by Clang static code analyzer:

    CC      block/qcow2-bitmap.o
  block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
      ret = -EINVAL;
      ^     ~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 block/qcow2-bitmap.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Richard Henderson Feb. 16, 2020, 2:11 a.m. UTC | #1
On 2/15/20 8:15 AM, Philippe Mathieu-Daudé wrote:
> Fix warning reported by Clang static code analyzer:
> 
>     CC      block/qcow2-bitmap.o
>   block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
>       ret = -EINVAL;
>       ^     ~~~~~~~
> 
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  block/qcow2-bitmap.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
Ján Tomko Feb. 16, 2020, 9:12 p.m. UTC | #2
On Sat, Feb 15, 2020 at 05:15:55PM +0100, Philippe Mathieu-Daudé wrote:
>Fix warning reported by Clang static code analyzer:
>
>    CC      block/qcow2-bitmap.o
>  block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
>      ret = -EINVAL;
>      ^     ~~~~~~~
>
>Reported-by: Clang Static Analyzer
>Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>---
> block/qcow2-bitmap.c | 1 -
> 1 file changed, 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Unused since its introduction in 88ddffae8fc1e30cc907c2dbb989b7eba9e62319

Jano
Vladimir Sementsov-Ogievskiy Feb. 17, 2020, 8:24 a.m. UTC | #3
15.02.2020 19:15, Philippe Mathieu-Daudé wrote:
> Fix warning reported by Clang static code analyzer:
> 
>      CC      block/qcow2-bitmap.o
>    block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
>        ret = -EINVAL;
>        ^     ~~~~~~~
> 
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>   block/qcow2-bitmap.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index d41f5d049b..8cccc2c9f3 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -647,7 +647,6 @@ static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
>       return bm_list;
>   
>   broken_dir:
> -    ret = -EINVAL;
>       error_setg(errp, "Broken bitmap directory");
>   
>   fail:
> 

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Kevin Wolf Feb. 17, 2020, 11:02 a.m. UTC | #4
Am 15.02.2020 um 17:15 hat Philippe Mathieu-Daudé geschrieben:
> Fix warning reported by Clang static code analyzer:
> 
>     CC      block/qcow2-bitmap.o
>   block/qcow2-bitmap.c:650:5: warning: Value stored to 'ret' is never read
>       ret = -EINVAL;
>       ^     ~~~~~~~
> 
> Reported-by: Clang Static Analyzer
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

This isn't hw/, so I'm taking it through my tree. Thanks, applied to the
block branch.

Kevin
diff mbox series

Patch

diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index d41f5d049b..8cccc2c9f3 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -647,7 +647,6 @@  static Qcow2BitmapList *bitmap_list_load(BlockDriverState *bs, uint64_t offset,
     return bm_list;
 
 broken_dir:
-    ret = -EINVAL;
     error_setg(errp, "Broken bitmap directory");
 
 fail: