qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 5/6] qcow2-refcount: remove dead assignment


From: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH 5/6] qcow2-refcount: remove dead assignment
Date: Wed, 13 Jan 2010 12:46:22 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 01/13/2010 11:54 AM, Amit Shah wrote:
clang-analyzer points out a redundant assignment.

Signed-off-by: Amit Shah<address@hidden>
---
  block/qcow2-refcount.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 54b19f8..3a2d44a 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -511,7 +511,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
      l2_table = NULL;
      l1_table = NULL;
      l1_size2 = l1_size * sizeof(uint64_t);
-    l1_allocated = 0;
      if (l1_table_offset != s->l1_table_offset) {
          if (l1_size2 != 0) {
              l1_table = qemu_mallocz(align_offset(l1_size2, 512));

I'd remove the l1_allocated = 0 assignment in the else branch instead (the idea is, assign l1_allocated = 1 right after any qemu_malloc.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]