Patchwork qed: remove unneeded variable assignment

login
register
mail settings
Submitter Pavel Borzenkov
Date Oct. 18, 2011, 5:17 p.m.
Message ID <1318958276-14049-1-git-send-email-pavel.borzenkov@gmail.com>
Download mbox | patch
Permalink /patch/120468/
State New
Headers show

Comments

Pavel Borzenkov - Oct. 18, 2011, 5:17 p.m.
'ret' is unconditionally overwitten by qed_read_l1_table_sync()

Spotted by Clang Analyzer

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
---
 block/qed.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Stefan Hajnoczi - Oct. 20, 2011, 5:23 p.m.
On Tue, Oct 18, 2011 at 09:17:56PM +0400, Pavel Borzenkov wrote:
> 'ret' is unconditionally overwitten by qed_read_l1_table_sync()
> 
> Spotted by Clang Analyzer
> 
> Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
> ---
>  block/qed.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

Thanks, applied to the trivial patches tree:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/trivial-patches

Stefan

Patch

diff --git a/block/qed.c b/block/qed.c
index e87dc4d..c3e45af 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -388,7 +388,6 @@  static int bdrv_qed_open(BlockDriverState *bs, int flags)
     if (ret < 0) {
         return ret;
     }
-    ret = 0; /* ret should always be 0 or -errno */
     qed_header_le_to_cpu(&le_header, &s->header);
 
     if (s->header.magic != QED_MAGIC) {