From patchwork Mon Jul 4 22:00:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra D Prabhu X-Patchwork-Id: 103175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 08C89B6F6B for ; Tue, 5 Jul 2011 08:13:12 +1000 (EST) Received: from localhost ([::1]:52477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdrO8-0002YF-AF for incoming@patchwork.ozlabs.org; Mon, 04 Jul 2011 18:13:08 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdrC5-0000XM-Fi for qemu-devel@nongnu.org; Mon, 04 Jul 2011 18:00:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdrC3-0005Gx-VJ for qemu-devel@nongnu.org; Mon, 04 Jul 2011 18:00:41 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:46032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdrC3-0005Go-Gp for qemu-devel@nongnu.org; Mon, 04 Jul 2011 18:00:39 -0400 Received: by pvg3 with SMTP id 3so6180875pvg.4 for ; Mon, 04 Jul 2011 15:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=5TvIq8IKn8KzrdKe32EKPKnI9kL67aaFFn/II12gmis=; b=IqjHbpwkgOPh0ew2wmclNI1SJOy6RsqgzfbfAnzXiyG8H1K19D9xRqXGVkvFA/YbW8 5Q5LSpNR3QEZUI/nIj9ypFzatfJSo4WtGrdr2Il8GYNaTWyO8CN70XFRWDsQfyI9vsGN MjCLFwfPDumXPjXdQZRuVAyZ7wkjeem6yKKjk= Received: by 10.68.22.72 with SMTP id b8mr7822034pbf.293.1309816837851; Mon, 04 Jul 2011 15:00:37 -0700 (PDT) Received: from localhost ([122.178.243.37]) by mx.google.com with ESMTPS id u6sm4096005pbh.80.2011.07.04.15.00.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 04 Jul 2011 15:00:37 -0700 (PDT) From: Raghavendra D Prabhu To: qemu-devel@nongnu.org Date: Tue, 5 Jul 2011 03:30:02 +0530 Message-Id: <2cb2082c25eadc24d1e22ebbd4293e3e6b53c832.1309816302.git.rprabhu@wnohang.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.83.173 Cc: Raghavendra D Prabhu , kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 3/3] Avoid Wunsed-but-set warnings (or errors in case of Werror) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In a few cases, variable attributed 'unused' has been added, in other cases unused variable has been either removed or commented out. Signed-off-by: Raghavendra D Prabhu --- hw/device-assignment.c | 6 +++--- simpletrace.c | 2 +- xen-mapcache.c | 7 ++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 36ad6b0..19a59b4 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -1654,7 +1654,7 @@ static void reset_assigned_device(DeviceState *dev) AssignedDevice *adev = DO_UPCAST(AssignedDevice, dev, pci_dev); char reset_file[64]; const char reset[] = "1"; - int fd, ret; + int fd, __attribute__((unused)) ret; snprintf(reset_file, sizeof(reset_file), "/sys/bus/pci/devices/%04x:%02x:%02x.%01x/reset", @@ -1682,7 +1682,7 @@ static void reset_assigned_device(DeviceState *dev) static int assigned_initfn(struct PCIDevice *pci_dev) { AssignedDevice *dev = DO_UPCAST(AssignedDevice, dev, pci_dev); - uint8_t e_device, e_intx; + uint8_t e_intx; int r; if (!kvm_enabled()) { @@ -1709,7 +1709,7 @@ static int assigned_initfn(struct PCIDevice *pci_dev) goto out; /* handle interrupt routing */ - e_device = (dev->dev.devfn >> 3) & 0x1f; + /*e_device = (dev->dev.devfn >> 3) & 0x1f;*/ e_intx = dev->dev.config[0x3d] - 1; dev->intpin = e_intx; dev->run = 0; diff --git a/simpletrace.c b/simpletrace.c index f1dbb5e..2ce9cff 100644 --- a/simpletrace.c +++ b/simpletrace.c @@ -119,7 +119,7 @@ static void *writeout_thread(void *opaque) TraceRecord record; unsigned int writeout_idx = 0; unsigned int num_available, idx; - size_t unused; + size_t __attribute__((unused)) unused; for (;;) { wait_for_trace_records_available(); diff --git a/xen-mapcache.c b/xen-mapcache.c index fac47cd..94642bc 100644 --- a/xen-mapcache.c +++ b/xen-mapcache.c @@ -166,7 +166,7 @@ static void qemu_remap_bucket(MapCacheEntry *entry, uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, uint8_t lock) { - MapCacheEntry *entry, *pentry = NULL; + MapCacheEntry *entry; target_phys_addr_t address_index = phys_addr >> MCACHE_BUCKET_SHIFT; target_phys_addr_t address_offset = phys_addr & (MCACHE_BUCKET_SIZE - 1); target_phys_addr_t __size = size; @@ -192,12 +192,10 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u (entry->paddr_index != address_index || entry->size != __size || !test_bits(address_offset >> XC_PAGE_SHIFT, size >> XC_PAGE_SHIFT, entry->valid_mapping))) { - pentry = entry; entry = entry->next; } if (!entry) { entry = qemu_mallocz(sizeof (MapCacheEntry)); - pentry->next = entry; qemu_remap_bucket(entry, __size, address_index); } else if (!entry->lock) { if (!entry->vaddr_base || entry->paddr_index != address_index || @@ -232,7 +230,7 @@ uint8_t *qemu_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, u ram_addr_t qemu_ram_addr_from_mapcache(void *ptr) { - MapCacheEntry *entry = NULL, *pentry = NULL; + MapCacheEntry *entry = NULL; MapCacheRev *reventry; target_phys_addr_t paddr_index; target_phys_addr_t size; @@ -258,7 +256,6 @@ ram_addr_t qemu_ram_addr_from_mapcache(void *ptr) entry = &mapcache->entry[paddr_index % mapcache->nr_buckets]; while (entry && (entry->paddr_index != paddr_index || entry->size != size)) { - pentry = entry; entry = entry->next; } if (!entry) {