Patchwork Fix a compilation error in xen-mapcache.c

login
register
mail settings
Submitter Stefan Berger
Date July 26, 2011, 2:33 p.m.
Message ID <1311690791.7898.6.camel@d941e-10>
Download mbox | patch
Permalink /patch/106875/
State New
Headers show

Comments

Stefan Berger - July 26, 2011, 2:33 p.m.
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

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

---
 xen-mapcache.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Peter Maydell - July 26, 2011, 2:38 p.m.
On 26 July 2011 15:33, Stefan Berger <stefanb@linux.vnet.ibm.com> wrote:
> 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
Stefan Berger - July 26, 2011, 2:45 p.m.
On 07/26/2011 10:38 AM, Peter Maydell wrote:
> On 26 July 2011 15:33, Stefan Berger<stefanb@linux.vnet.ibm.com>  wrote:
>> 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

> -- PMM
Anthony Liguori - July 29, 2011, 2:38 p.m.
On 07/26/2011 09:33 AM, Stefan Berger wrote:
> 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
>
> Signed-off-by: Stefan Berger<stefanb@linux.vnet.ibm.com>

Applied.  Thanks.

Regards,

Anthony Liguori

>
> ---
>   xen-mapcache.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: qemu-git/xen-mapcache.c
> ===================================================================
> --- qemu-git.orig/xen-mapcache.c
> +++ 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) {
>
>
>

Patch

Index: qemu-git/xen-mapcache.c
===================================================================
--- qemu-git.orig/xen-mapcache.c
+++ 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) {