From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljg6E-0006Um-B7 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljg69-0006Rt-Uf for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:21 -0400 Received: from [199.232.76.173] (port=57242 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljg69-0006Re-Hl for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:17 -0400 Received: from mx1.redhat.com ([66.187.233.31]:45043) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ljg69-0004Jr-7a for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:17 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2HKfGuN020324 for ; Tue, 17 Mar 2009 16:41:17 -0400 From: Uri Lublin Date: Tue, 17 Mar 2009 22:40:49 +0200 Message-Id: <1237322452-11337-12-git-send-email-uril@redhat.com> In-Reply-To: <1237322452-11337-11-git-send-email-uril@redhat.com> References: <1237322452-11337-1-git-send-email-uril@redhat.com> <1237322452-11337-2-git-send-email-uril@redhat.com> <1237322452-11337-3-git-send-email-uril@redhat.com> <1237322452-11337-4-git-send-email-uril@redhat.com> <1237322452-11337-5-git-send-email-uril@redhat.com> <1237322452-11337-6-git-send-email-uril@redhat.com> <1237322452-11337-7-git-send-email-uril@redhat.com> <1237322452-11337-8-git-send-email-uril@redhat.com> <1237322452-11337-9-git-send-email-uril@redhat.com> <1237322452-11337-10-git-send-email-uril@redhat.com> <1237322452-11337-11-git-send-email-uril@redhat.com> Subject: [Qemu-devel] [PATCH 11/14] qcow2: qcow_read_extensions: make "advance offset over extension" common Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Take it out of the switch statement (and each "case"). Signed-off-by: Uri Lublin --- block-qcow2.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/block-qcow2.c b/block-qcow2.c index ed84a56..c98024e 100644 --- a/block-qcow2.c +++ b/block-qcow2.c @@ -257,7 +257,6 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, #ifdef DEBUG_EXT printf("Qcow2: Got format extension %s\n", bs->backing_format); #endif - offset += ((ext.len + 7) & ~7); break; case QCOW_EXT_MAGIC_HIGH_ALLOC: @@ -275,14 +274,14 @@ static int qcow_read_extensions(BlockDriverState *bs, uint64_t start_offset, #ifdef DEBUG_EXT printf("Qcow2: Got highest_alloc 0x%lu\n", s->highest_alloc); #endif - offset += ((ext.len + 7) & ~7); break; default: /* unknown magic -- just skip it */ - offset += ((ext.len + 7) & ~7); break; } + offset += ((ext.len + 7) & ~7); + } return 0; -- 1.6.0.6