Эх сурвалжийг харах

xen: gntdev: fix build warning

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@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Ian Campbell 14 жил өмнө
parent
commit
38eaeb0fd8

+ 1 - 2
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)
 static int map_grant_pages(struct grant_map *map)
 {
 {
 	int i, err = 0;
 	int i, err = 0;
-	phys_addr_t addr;
 
 
 	if (!use_ptemod) {
 	if (!use_ptemod) {
 		/* Note: it could already be mapped */
 		/* Note: it could already be mapped */
 		if (map->map_ops[0].handle != -1)
 		if (map->map_ops[0].handle != -1)
 			return 0;
 			return 0;
 		for (i = 0; i < map->count; i++) {
 		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]));
 				pfn_to_kaddr(page_to_pfn(map->pages[i]));
 			gnttab_set_map_op(&map->map_ops[i], addr, map->flags,
 			gnttab_set_map_op(&map->map_ops[i], addr, map->flags,
 				map->grants[i].ref,
 				map->grants[i].ref,