Skip to content

Commit

Permalink
blockdev: Remove dead assignment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
philmd authored and vivier committed May 4, 2020
1 parent dfde483 commit 1fe5a8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blockdev.c
Expand Up @@ -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:
Expand Down

0 comments on commit 1fe5a8c

Please sign in to comment.