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

Philippe Mathieu-Daudé posted 3 patches 5 years, 9 months ago
Maintainers: "Philippe Mathieu-Daudé" <philmd@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>, Max Reitz <mreitz@redhat.com>, John Snow <jsnow@redhat.com>
[PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Posted by Philippe Mathieu-Daudé 5 years, 9 months ago
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:
-- 
2.21.1


Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Posted by Kevin Wolf 5 years, 9 months ago
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


Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Posted by Vladimir Sementsov-Ogievskiy 5 years, 9 months ago
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>


-- 
Best regards,
Vladimir

Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Posted by Ján Tomko 5 years, 9 months ago
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
Re: [PATCH 1/3] block/qcow2-bitmap: Remove unneeded variable assignment
Posted by Richard Henderson 5 years, 9 months ago
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~