diff mbox

[1/2] qcow2: remove a line of unnecessary code

Message ID 1335598662-18083-1-git-send-email-zwu.kernel@gmail.com
State New
Headers show

Commit Message

Zhiyong Wu April 28, 2012, 7:37 a.m. UTC
From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
---
 block/qcow2-cluster.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Comments

Stefan Hajnoczi April 30, 2012, 12:40 p.m. UTC | #1
On Sat, Apr 28, 2012 at 8:37 AM,  <zwu.kernel@gmail.com> wrote:
> From: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
>
> Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
> ---
>  block/qcow2-cluster.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

I took a look to understand why that line of code was there.  This can
be important in case there was a mis-merge.

commit 3948d1d4876065160583e79533bf604481063833
Author: Kevin Wolf <kwolf@redhat.com>
Date:   Mon Mar 12 17:46:51 2012 +0100

    qcow2: Remove unused parameter in get_cluster_table()

    Since everything goes through the cache, callers don't use the L2 table
    offset any more.

This commit removed the pointer argument we filled in with l2_offset
but forgot to remove the unnecessary l2_offset assignment.

It's worth adding this sort of info into commit descriptions in the future.

Stefan
diff mbox

Patch

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index a747a88..b048821 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -538,7 +538,6 @@  static int get_cluster_table(BlockDriverState *bs, uint64_t offset,
         if (l2_offset) {
             qcow2_free_clusters(bs, l2_offset, s->l2_size * sizeof(uint64_t));
         }
-        l2_offset = s->l1_table[l1_index] & L1E_OFFSET_MASK;
     }
 
     /* find the cluster offset for the given disk offset */