From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: [PATCH] kvm tool: Remove unused variables from the QCOW code Date: Thu, 14 Apr 2011 08:18:55 +0200 Message-ID: <20110414061855.GA5375@elte.hu> References: <1302722762-30517-1-git-send-email-prasadjoshi124@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE 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 To: Pekka Enberg Return-path: 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 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Newer versions of GCC notice the following unused variables: qcow.c: In function =E2=80=98qcow_read_l1_table=E2=80=99: qcow.c:56:7: error: variable =E2=80=98page_offset=E2=80=99 set but not= used [-Werror=3Dunused-but-set-variable] qcow.c:54:6: error: variable =E2=80=98map_offset=E2=80=99 set but not = used [-Werror=3Dunused-but-set-variable] cc1: all warnings being treated as errors make: *** [qcow.o] Error 1 Remove them. Signed-off-by: Ingo Molnar --- 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 =3D q->header; struct qcow_table *table; u64 table_offset; - u64 map_offset; - const long page_size =3D sysconf(_SC_PAGESIZE); - long page_offset; u32 l1_i; =20 q->table =3D table =3D calloc(1, sizeof(struct qcow_table)); @@ -63,9 +60,6 @@ int qcow_read_l1_table(struct qcow *q) table->table_size =3D qcow1_get_table_size(q); table_offset =3D h->l1_table_offset; =20 - map_offset =3D table_offset & page_size; - page_offset =3D table_offset & (~page_size); - table->l1_table =3D calloc(table->table_size, sizeof(u64)); if (!table->l1_table) goto error;