fix missing header and gcc warning
PATCH 1/1 fix missing header and gcc warning
Explicaly include <xen/domain_page.h> for map_domain_page() and fix warning. gcc says:
warning: pointer of type 'void *' used in arithmetic
looks like only powerpc has -Wpointer-arith turned on.
---
xen/common/grant_table.c +4 -1
@@ -30,6 +30,7 @@#include <xen/mm.h> #include <xen/trace.h> #include <xen/guest_access.h> +#include <xen/domain_page.h> #include <acm/acm_hooks.h> /*
@@ -902,7 +903,9 @@ __gnttab_copy( sp =map_domain_page (s_frame); dp =map_domain_page (d_frame); -memcpy (dp + op->dest.offset, sp + op->source.offset, op->len); +memcpy ((void *)((ulong )dp + op->dest.offset), + (void *)((ulong )sp + op->source.offset), + op->len);unmap_domain_page (dp);unmap_domain_page (sp);
Quoted 11 lines · Jimi Xenidis
Explicaly include <
xen/domain_page.h> formap_domain_page()and fix warning. gcc says:
warning: pointer of type 'void *' used in arithmetic
looks like only powerpc has -Wpointer-arith turned on.Signed-off-by Jimi Xenidis <[email protected]>---
diff -rc87f89fc7be4xen/common/grant_table.cxen/common/grant_table.c +0
-0
[...]
xen/common/grant_table.c __gnttab_copy( · line 908
Quoted 8 lines
xen/common/grant_table.c +3
-1@@ -902,7 +903,9 @@ __gnttab_copy( sp =map_domain_page (s_frame); dp =map_domain_page (d_frame); -memcpy (dp + op->dest.offset, sp + op->source.offset, op->len); +memcpy ((void *)((ulong )dp + op->dest.offset), + (void *)((ulong )sp + op->source.offset), + op->len);
I find this needlessly ugly. Why not just declare sp and dp char *?
Quoted 4 lines
xen/common/grant_table.c +0
-0unmap_domain_page (dp);unmap_domain_page (sp);
Quoted 6 lines · Markus Armbruster
xen/common/grant_table.c __gnttab_copy( · line 908
Quoted 4 lines
xen/common/grant_table.c +3
-1-memcpy (dp + op->dest.offset, sp + op->source.offset, op->len); +memcpy ((void *)((ulong )dp + op->dest.offset), + (void *)((ulong )sp + op->source.offset), + op->len);I find this needlessly ugly. Why not just declare sp and dp char *?
That's what I checked in.
-- Keir