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

Re: [Xen-devel] [PATCH][XEN] fix missing header and gcc warning

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH][XEN] fix missing header and gcc warning
From: Markus Armbruster <armbru@xxxxxxxxxx>
Date: Mon, 14 Aug 2006 08:36:03 +0200
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 13 Aug 2006 23:36:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <E1GCJMd-0000K0-Ua@xxxxxxxxxxxxxxxxxxx> (Jimi Xenidis's message of "Sun, 13 Aug 2006 13:03:03 -0400")
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <E1GCJMd-0000K0-Ua@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)
Jimi Xenidis <jimix@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxx>
>
> ---
> 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>