Skip to contentSkip to conversation

Fix a compilation error in xen-mapcache.c

PATCH Applied Stefan Berger 3 participants 4 messages Jul 26, 2011 – Jul 29, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a compilation error in xen-mapcache.c

This patch fixes a compilation error in xen-mapcache.c .

/home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’:
/home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

---
 xen-mapcache.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-mapcache.c +1 -2
Index: qemu-git/xen-mapcache.c
===================================================================
@@ -237,7 +237,7 @@ uint8_t *xen_map_cache(target_phys_addr_
 
 ram_addr_t xen_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;
@@ -263,7 +263,6 @@ ram_addr_t xen_ram_addr_from_mapcache(vo
 
     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) {
#1 lore raw
Quoted 5 lines · Stefan Berger

This patch fixes a compilation error in xen-mapcache.c .

/home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’:
/home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Juan posted a fix for this back on the 11th:

http://patchwork.ozlabs.org/patch/104254/

-- PMM

#2 lore raw
Quoted 10 lines · Peter Maydell
Quoted 5 lines · Stefan Berger

This patch fixes a compilation error in xen-mapcache.c .

/home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’:
/home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Juan posted a fix for this back on the 11th:

http://patchwork.ozlabs.org/patch/104254/

Then I can only emphasize the importance of this patch.

Stefan

Quoted 1 line

-- PMM

#3 lore raw
In reply to Stefan Berger
Quoted 7 lines · Stefan Berger

This patch fixes a compilation error in xen-mapcache.c .

/home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’:
/home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 29 lines
---
  xen-mapcache.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

Index: qemu-git/xen-mapcache.c
===================================================================

xen-mapcache.c +1 -2
@@ -237,7 +237,7 @@ uint8_t *xen_map_cache(target_phys_addr_
 
  ram_addr_t xen_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;
@@ -263,7 +263,6 @@ ram_addr_t xen_ram_addr_from_mapcache(vo
 
      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) {