public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Pekka Enberg <penberg@kernel.org>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>,
	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
Date: Thu, 14 Apr 2011 08:18:55 +0200	[thread overview]
Message-ID: <20110414061855.GA5375@elte.hu> (raw)
In-Reply-To: <alpine.DEB.2.00.1104132247360.6875@tiger>


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 <mingo@elte.hu>
---
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;

  reply	other threads:[~2011-04-14  6:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-13 19:26 [PATCH v2] kvm tool: add QCOW verions 1 read/write support Prasad Joshi
2011-04-13 19:48 ` Pekka Enberg
2011-04-14  6:18   ` Ingo Molnar [this message]
2011-04-14  8:02 ` Kevin Wolf
2011-04-14  8:07   ` Ingo Molnar
2011-04-14  8:12     ` Kevin Wolf
2011-04-14  8:15       ` Pekka Enberg
2011-04-14  8:26         ` Kevin Wolf
2011-04-14  8:27           ` Ingo Molnar
2011-04-14  9:23             ` Prasad Joshi
2011-04-14  9:28               ` Ingo Molnar
2011-04-14  9:53               ` Pekka Enberg
2011-04-14  8:25       ` Ingo Molnar
2011-04-14  8:21   ` Pekka Enberg
2011-04-14  8:31     ` Kevin Wolf
2011-04-14  8:32       ` Pekka Enberg
2011-04-14  8:49         ` Alon Levy
2011-04-14  8:52         ` Kevin Wolf
2011-04-14  9:26           ` Markus Armbruster
2011-04-14  9:52             ` Kevin Wolf
2011-04-14 10:02               ` Markus Armbruster
2011-04-14  9:53             ` Stefan Hajnoczi
2011-04-14 14:59           ` Anthony Liguori
2011-04-15  6:41   ` Why QCOW1? (was: [PATCH v2] kvm tool: add QCOW verions 1 read/write support) Markus Armbruster
2011-04-15  6:45     ` Pekka Enberg
2011-04-15 10:14       ` Stefan Hajnoczi
2011-04-15 11:17         ` Pekka Enberg
2011-04-15 12:05           ` Stefan Hajnoczi
2011-04-15 12:10             ` Pekka Enberg
2011-04-15 12:17             ` Why QCOW1? Kevin Wolf
2011-04-15 12:12           ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110414061855.GA5375@elte.hu \
    --to=mingo@elte.hu \
    --cc=asias.hejun@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwolf@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox