From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhPDu-0005zp-Q1 for qemu-devel@nongnu.org; Thu, 23 Oct 2014 16:43:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XhPDl-0002MF-NA for qemu-devel@nongnu.org; Thu, 23 Oct 2014 16:43:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XhPDl-0002Lq-G1 for qemu-devel@nongnu.org; Thu, 23 Oct 2014 16:42:57 -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 s9NKgu4c001206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 23 Oct 2014 16:42:56 -0400 From: Kevin Wolf Date: Thu, 23 Oct 2014 22:42:17 +0200 Message-Id: <1414096959-14682-11-git-send-email-kwolf@redhat.com> In-Reply-To: <1414096959-14682-1-git-send-email-kwolf@redhat.com> References: <1414096959-14682-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 10/32] qcow2: Use sizeof(**refcount_table) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com From: Max Reitz When implementing variable refcounts, we want to be able to easily find all the places in qemu which are tied to a certain refcount order. Replace sizeof(uint16_t) in the check code by sizeof(**refcount_table) so we can later find it more easily. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qcow2-refcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index e5f7876..e8b9df9 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -1647,7 +1647,7 @@ static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res, *nb_clusters); memset(&(*refcount_table)[old_nb_clusters], 0, (*nb_clusters - old_nb_clusters) * - sizeof(uint16_t)); + sizeof(**refcount_table)); } (*refcount_table)[cluster]--; inc_refcounts(bs, res, *refcount_table, *nb_clusters, -- 1.8.3.1