summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-04-22 15:31:45 +0200
committerLaurent Vivier <laurent@vivier.eu>2020-05-04 14:43:24 +0200
commit1fe5a8c2cd5dc0da03a4246474abf37f0e8cc8c0 (patch)
treeaefc1a7af24080473cfa21d03dd4a54c79c6b15b
parentdfde483ea38ce221e8e634823620308550b8f7f0 (diff)
downloadfocaccia-qemu-1fe5a8c2cd5dc0da03a4246474abf37f0e8cc8c0.tar.gz
focaccia-qemu-1fe5a8c2cd5dc0da03a4246474abf37f0e8cc8c0.zip
blockdev: Remove dead assignment
Fix warning reported by Clang static code analyzer:

    CC      blockdev.o
  blockdev.c:2744:5: warning: Value stored to 'ret' is never read
      ret = blk_truncate(blk, size, false, PREALLOC_MODE_OFF, errp);
      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200422133152.16770-3-philmd@redhat.com>
[lv: fix conflict because of "Add flags to blk_truncate()"]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r--blockdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index dc1a0c7c2f..708d0c323f 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2741,7 +2741,7 @@ void qmp_block_resize(bool has_device, const char *device,
     }
 
     bdrv_drained_begin(bs);
-    ret = blk_truncate(blk, size, false, PREALLOC_MODE_OFF, 0, errp);
+    blk_truncate(blk, size, false, PREALLOC_MODE_OFF, 0, errp);
     bdrv_drained_end(bs);
 
 out: