WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen: gntdev: fix build warning

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] xen: gntdev: fix build warning
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 8 Mar 2011 16:56:43 +0000
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, Ian Campbell <ian.campbell@xxxxxxxxxx>, konrad.wilk@xxxxxxxxxx
Delivery-date: Tue, 08 Mar 2011 08:59:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
addr is actually a virtual address so use an unsigned long. Fixes:

  CC      drivers/xen/gntdev.o
drivers/xen/gntdev.c: In function 'map_grant_pages':
drivers/xen/gntdev.c:268: warning: cast from pointer to integer of different 
size

Reduce the scope of the variable at the same time.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 drivers/xen/gntdev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index d43ff30..d96d311 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -257,14 +257,13 @@ static int find_grant_ptes(pte_t *pte, pgtable_t token,
 static int map_grant_pages(struct grant_map *map)
 {
        int i, err = 0;
-       phys_addr_t addr;
 
        if (!use_ptemod) {
                /* Note: it could already be mapped */
                if (map->map_ops[0].handle != -1)
                        return 0;
                for (i = 0; i < map->count; i++) {
-                       addr = (phys_addr_t)
+                       unsigned long addr = (unsigned long)
                                pfn_to_kaddr(page_to_pfn(map->pages[i]));
                        gnttab_set_map_op(&map->map_ops[i], addr, map->flags,
                                map->grants[i].ref,
-- 
1.5.6.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xen: gntdev: fix build warning, Ian Campbell <=