From patchwork Thu Apr 14 06:18:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ingo Molnar X-Patchwork-Id: 706321 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3E6JWe7015254 for ; Thu, 14 Apr 2011 06:19:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756676Ab1DNGTT (ORCPT ); Thu, 14 Apr 2011 02:19:19 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:39803 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752146Ab1DNGTS (ORCPT ); Thu, 14 Apr 2011 02:19:18 -0400 Received: from elvis.elte.hu ([157.181.1.14]) by mx2.mail.elte.hu with esmtp (Exim) id 1QAFtL-0003Eu-TS from ; Thu, 14 Apr 2011 08:19:05 +0200 Received: by elvis.elte.hu (Postfix, from userid 1004) id B0FD53E250F; Thu, 14 Apr 2011 08:18:50 +0200 (CEST) Date: Thu, 14 Apr 2011 08:18:55 +0200 From: Ingo Molnar To: Pekka Enberg Cc: Prasad Joshi , kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, levinsasha928@gmail.com, kwolf@redhat.com, stefanha@linux.vnet.ibm.com Subject: [PATCH] kvm tool: Remove unused variables from the QCOW code Message-ID: <20110414061855.GA5375@elte.hu> References: <1302722762-30517-1-git-send-email-prasadjoshi124@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu; X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Apr 2011 06:19:35 +0000 (UTC) Newer versions of GCC notice the following unused variables: qcow.c: In function ‘qcow_read_l1_table’: qcow.c:56:7: error: variable ‘page_offset’ set but not used [-Werror=unused-but-set-variable] qcow.c:54:6: error: variable ‘map_offset’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors make: *** [qcow.o] Error 1 Remove them. Signed-off-by: Ingo Molnar --- -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/qcow.c b/tools/kvm/qcow.c index 1764975..a3e0537 100644 --- a/tools/kvm/qcow.c +++ b/tools/kvm/qcow.c @@ -51,9 +51,6 @@ int qcow_read_l1_table(struct qcow *q) struct qcow1_header *h = q->header; struct qcow_table *table; u64 table_offset; - u64 map_offset; - const long page_size = sysconf(_SC_PAGESIZE); - long page_offset; u32 l1_i; q->table = table = calloc(1, sizeof(struct qcow_table)); @@ -63,9 +60,6 @@ int qcow_read_l1_table(struct qcow *q) table->table_size = qcow1_get_table_size(q); table_offset = h->l1_table_offset; - map_offset = table_offset & page_size; - page_offset = table_offset & (~page_size); - table->l1_table = calloc(table->table_size, sizeof(u64)); if (!table->l1_table) goto error;