diff mbox

qed: remove unneeded variable assignment

Message ID 1318958276-14049-1-git-send-email-pavel.borzenkov@gmail.com
State New
Headers show

Commit Message

Pavel Borzenkov Oct. 18, 2011, 5:17 p.m. UTC
'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(-)

Comments

Stefan Hajnoczi Oct. 20, 2011, 5:23 p.m. UTC | #1
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
diff mbox

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) {