Received: from eggs.gnu.org ([2001:4830:134:3::10]:43943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6gAg-0003AK-LK for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6gAa-0003LX-Mb for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:15:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1934) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6gAa-0003LM-FJ for qemu-devel@nongnu.org; Tue, 06 Aug 2013 08:15:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r76CFIC7005498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Aug 2013 08:15:19 -0400 Date: Tue, 6 Aug 2013 14:15:13 +0200 From: Kevin Wolf Message-ID: <20130806121513.GC15400@dhcp-200-207.str.redhat.com> References: <1375775095-19456-1-git-send-email-famz@redhat.com> <1375775095-19456-2-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1375775095-19456-2-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 01/10] vmdk: remove ret from inner scope. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: pmatouse@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, stefanha@redhat.com, asias@redhat.com, areis@redhat.com Am 06.08.2013 um 09:44 hat Fam Zheng geschrieben: > A inner scope "ret" variable hides the real return code, it will always > return VMDK_OK for bs->backing_hd. Fix this by removing the declaration. > > Signed-off-by: Fam Zheng In the original code there is no problem. > --- > block/vmdk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/vmdk.c b/block/vmdk.c > index 3756333..f42657b 100644 > --- a/block/vmdk.c > +++ b/block/vmdk.c > @@ -813,8 +813,8 @@ static int get_whole_cluster(BlockDriverState *bs, > /* we will be here if it's first write on non-exist grain(cluster). > * try to read from parent image, if exist */ > if (bs->backing_hd) { > - int ret; > - > + whole_grain = > + qemu_blockalign(bs, extent->cluster_sectors << BDRV_SECTOR_BITS); > if (!vmdk_is_cid_valid(bs)) { > return VMDK_ERROR; > } After this patch, there are two: block/vmdk.c: In function 'get_whole_cluster': block/vmdk.c:816:21: error: incompatible types when assigning to type 'uint8_t[(sizetype)(extent->cluster_sectors * 512u)]' from type 'void *' block/vmdk.c:824:9: error: 'ret' undeclared (first use in this function) Kevin