Jimi Xenidis
2006-Aug-13 17:03 UTC
[Xen-devel] [PATCH][XEN] 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.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
---
diff -r c87f89fc7be4 xen/common/grant_table.c
--- a/xen/common/grant_table.c Sun Aug 13 12:53:19 2006 -0400
+++ b/xen/common/grant_table.c Sun Aug 13 13:02:03 2006 -0400
@@ -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);
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Markus Armbruster
2006-Aug-14 06:36 UTC
Re: [Xen-devel] [PATCH][XEN] fix missing header and gcc warning
Jimi Xenidis <jimix@watson.ibm.com> writes:> 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. > > Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com> > > --- > diff -r c87f89fc7be4 xen/common/grant_table.c > --- a/xen/common/grant_table.c Sun Aug 13 12:53:19 2006 -0400 > +++ b/xen/common/grant_table.c Sun Aug 13 13:02:03 2006 -0400[...]> @@ -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 *?> > unmap_domain_page(dp); > unmap_domain_page(sp); >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Aug-14 08:37 UTC
Re: [Xen-devel] [PATCH][XEN] fix missing header and gcc warning
On 14/8/06 7:36 am, "Markus Armbruster" <armbru@redhat.com> wrote:>> - 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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel