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-changelog

[Xen-changelog] [xen-unstable] [IA64] remove warnings in replace_grant_h

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] remove warnings in replace_grant_host_mapping()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 May 2008 08:30:32 -0700
Delivery-date: Tue, 20 May 2008 08:31:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210828718 -32400
# Node ID f0737df2dee1150a19283fffb26c57e4b06f1874
# Parent  24cbbd5e31551c152cc8ae7e69e85d75857c2430
[IA64] remove warnings in replace_grant_host_mapping()

This patch removes warnings in replace_grant_host_mapping().
> mm.c: In function 'replace_grant_host_mapping':
> mm.c:2194: warning: 'new_page_mfn' may be used uninitialized in this function
> mm.c:2190: warning: 'old_pte.pte' may be used uninitialized in this function
> mm.c:2188: warning: 'cur_pte.pte' may be used uninitialized in this function

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/mm.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff -r 24cbbd5e3155 -r f0737df2dee1 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c    Thu May 15 14:18:38 2008 +0900
+++ b/xen/arch/ia64/xen/mm.c    Thu May 15 14:18:38 2008 +0900
@@ -2191,7 +2191,7 @@ replace_grant_host_mapping(unsigned long
     struct page_info* page = mfn_to_page(mfn);
     struct page_info* new_page = NULL;
     volatile pte_t* new_page_pte = NULL;
-    unsigned long new_page_mfn;
+    unsigned long new_page_mfn = INVALID_MFN;
 
     if (new_gpaddr) {
         new_page_pte = lookup_noalloc_domain_pte_none(d, new_gpaddr);
@@ -2211,7 +2211,7 @@ replace_grant_host_mapping(unsigned long
                              "new_gpaddr 0x%lx mfn 0x%lx\n",
                              __func__, gpaddr, mfn, new_gpaddr, new_page_mfn);
                     new_page = NULL; /* prevent domain_put_page() */
-                    goto out;
+                    return GNTST_general_error;
                 }
 
                 /*
@@ -2228,7 +2228,7 @@ replace_grant_host_mapping(unsigned long
                                  "new_gpaddr 0x%lx mfn 0x%lx\n",
                                  __func__, gpaddr, mfn,
                                  new_gpaddr, new_page_mfn);
-                        goto out;
+                        return GNTST_general_error;
                     }
                 }
                 domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 0);
@@ -2246,7 +2246,7 @@ replace_grant_host_mapping(unsigned long
     if (pte == NULL) {
         gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx\n",
                 __func__, gpaddr, mfn);
-        goto out;
+        return GNTST_general_error;
     }
 
  again:
@@ -2256,10 +2256,11 @@ replace_grant_host_mapping(unsigned long
         (page_get_owner(page) == d && get_gpfn_from_mfn(mfn) == gpfn)) {
         gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx cur_pte 0x%lx\n",
                 __func__, gpaddr, mfn, pte_val(cur_pte));
-        goto out;
+        return GNTST_general_error;
     }
 
     if (new_page) {
+        BUG_ON(new_page_mfn == INVALID_MFN);
         set_gpfn_from_mfn(new_page_mfn, gpfn);
         /* smp_mb() isn't needed because assign_domain_pge_cmpxchg_rel()
            has release semantics. */
@@ -2270,6 +2271,7 @@ replace_grant_host_mapping(unsigned long
             goto again;
         }
         if (new_page) {
+            BUG_ON(new_page_mfn == INVALID_MFN);
             set_gpfn_from_mfn(new_page_mfn, INVALID_M2P_ENTRY);
             domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 1);
         }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [IA64] remove warnings in replace_grant_host_mapping(), Xen patchbot-unstable <=