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] Re: [PATCH 3/3] xen p2m: annotate variable which appears unu

To: Ian Campbell <ian.campbell@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 3/3] xen p2m: annotate variable which appears unused
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Fri, 11 Feb 2011 10:37:23 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Fri, 11 Feb 2011 07:38:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1297437838-14797-3-git-send-email-ian.campbell@xxxxxxxxxx>
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>
References: <1297437838-14797-1-git-send-email-ian.campbell@xxxxxxxxxx> <1297437838-14797-2-git-send-email-ian.campbell@xxxxxxxxxx> <1297437838-14797-3-git-send-email-ian.campbell@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Feb 11, 2011 at 03:23:58PM +0000, Ian Campbell wrote:
>  CC      arch/x86/xen/p2m.o
> arch/x86/xen/p2m.c: In function 'm2p_remove_override':
> arch/x86/xen/p2m.c:460: warning: 'address' may be used uninitialized in this 
> function
> arch/x86/xen/p2m.c: In function 'm2p_add_override':
> arch/x86/xen/p2m.c:426: warning: 'address' may be used uninitialized in this 
> function

Thanks for  doing those. I've been seeing them for weeks now and just never
got off to fixing them.
> 
> In actual fact address is inialised in one "if (!PageHighMem(page))"
> statement and used in a second and so is always initialised before
> use.
> 
> Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
>  arch/x86/xen/p2m.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 53fe9fc..3720efa 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -421,7 +421,7 @@ int m2p_add_override(unsigned long mfn, struct page *page)
>  {
>       unsigned long flags;
>       unsigned long pfn;
> -     unsigned long address;
> +     unsigned long uninitialized_var(address);
>       unsigned level;
>       pte_t *ptep = NULL;
>  
> @@ -455,7 +455,7 @@ int m2p_remove_override(struct page *page)
>       unsigned long flags;
>       unsigned long mfn;
>       unsigned long pfn;
> -     unsigned long address;
> +     unsigned long uninitialized_var(address);
>       unsigned level;
>       pte_t *ptep = NULL;
>  
> -- 
> 1.5.6.5

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