From patchwork Sat Jan 29 08:41:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 80933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 37B2B1007D1 for ; Sat, 29 Jan 2011 19:43:43 +1100 (EST) Received: from localhost ([127.0.0.1]:32786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pj6PE-0002ST-BD for incoming@patchwork.ozlabs.org; Sat, 29 Jan 2011 03:43:40 -0500 Received: from [140.186.70.92] (port=47383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pj6Na-00020j-QU for qemu-devel@nongnu.org; Sat, 29 Jan 2011 03:42:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pj6NO-0000Ig-FT for qemu-devel@nongnu.org; Sat, 29 Jan 2011 03:41:58 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:48487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pj6NO-0000IJ-6R for qemu-devel@nongnu.org; Sat, 29 Jan 2011 03:41:46 -0500 Received: by pzk2 with SMTP id 2so655827pzk.4 for ; Sat, 29 Jan 2011 00:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=2BTH8KdnX6F3Etix62BF8GA3ZNKu3OZ/LMbyrmF2IZ8=; b=HAr8tZ574BcldPPogcu7iCI6h94dOuUkPHAnDAAVRFuolyoS+qjHapPOcoAenhQbKG zmePnlnpc0aBqMmdTW6n8b4GB2BkGpfLsc+2s9ydpCZ5kiLrJe7IA+Gvd9xfmyeJWEFN zLU9vVGFdrdM3T3vko3XWdKXJ1BVQayYHytXQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=DFQ9jEzTMPwuX9JrbxpTKYDSJuLyCf9Hwv9Rn+tXeEIIaPsvnmvlWxqZV3yvHMFKQi j8rHAyEgTwNyOCvph3IFSKOjW/7eMQsuuEazYmJSxYl78DiFCvJ8S9rLLqaGoSr1iqa3 /RLfCL5kiYood2P+3kY2rQC4FG7pWFfHEqid0= Received: by 10.142.161.16 with SMTP id j16mr3978222wfe.116.1296290505081; Sat, 29 Jan 2011 00:41:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.241.1 with HTTP; Sat, 29 Jan 2011 00:41:24 -0800 (PST) From: Blue Swirl Date: Sat, 29 Jan 2011 08:41:24 +0000 Message-ID: To: Kevin Wolf , qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.45 Cc: Subject: [Qemu-devel] [PATCH] qcow2-refcount: remove write-only variables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Variables l2_modified and l2_size are not really used, remove them. Spotted by GCC 4.6.0: CC block/qcow2-refcount.o /src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount': /src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified' set but not used [-Werror=unused-but-set-variable] /src/qemu/block/qcow2-refcount.c:708:9: error: variable 'l2_size' set but not used [-Werror=unused-but-set-variable] CC: Kevin Wolf Signed-off-by: Blue Swirl --- block/qcow2-refcount.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-) } diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index e37e226..915d85a 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -705,7 +705,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, BDRVQcowState *s = bs->opaque; uint64_t *l1_table, *l2_table, l2_offset, offset, l1_size2, l1_allocated; int64_t old_offset, old_l2_offset; - int l2_size, i, j, l1_modified, l2_modified, nb_csectors, refcount; + int i, j, l1_modified, nb_csectors, refcount; int ret; l2_table = NULL; @@ -729,14 +729,12 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, l1_allocated = 0; } - l2_size = s->l2_size * sizeof(uint64_t); l1_modified = 0; for(i = 0; i < l1_size; i++) { l2_offset = l1_table[i]; if (l2_offset) { old_l2_offset = l2_offset; l2_offset &= ~QCOW_OFLAG_COPIED; - l2_modified = 0; ret = qcow2_cache_get(bs, s->l2_table_cache, l2_offset, (void**) &l2_table); @@ -788,7 +786,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs, s->refcount_block_cache); } l2_table[j] = cpu_to_be64(offset); - l2_modified = 1; qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table); }