ia64/xen-unstable

changeset 17605:f0737df2dee1

[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@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Thu May 15 14:18:38 2008 +0900 (2008-05-15)
parents 24cbbd5e3155
children b03e24f9c1d8
files xen/arch/ia64/xen/mm.c
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Thu May 15 14:18:38 2008 +0900
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Thu May 15 14:18:38 2008 +0900
     1.3 @@ -2191,7 +2191,7 @@ replace_grant_host_mapping(unsigned long
     1.4      struct page_info* page = mfn_to_page(mfn);
     1.5      struct page_info* new_page = NULL;
     1.6      volatile pte_t* new_page_pte = NULL;
     1.7 -    unsigned long new_page_mfn;
     1.8 +    unsigned long new_page_mfn = INVALID_MFN;
     1.9  
    1.10      if (new_gpaddr) {
    1.11          new_page_pte = lookup_noalloc_domain_pte_none(d, new_gpaddr);
    1.12 @@ -2211,7 +2211,7 @@ replace_grant_host_mapping(unsigned long
    1.13                               "new_gpaddr 0x%lx mfn 0x%lx\n",
    1.14                               __func__, gpaddr, mfn, new_gpaddr, new_page_mfn);
    1.15                      new_page = NULL; /* prevent domain_put_page() */
    1.16 -                    goto out;
    1.17 +                    return GNTST_general_error;
    1.18                  }
    1.19  
    1.20                  /*
    1.21 @@ -2228,7 +2228,7 @@ replace_grant_host_mapping(unsigned long
    1.22                                   "new_gpaddr 0x%lx mfn 0x%lx\n",
    1.23                                   __func__, gpaddr, mfn,
    1.24                                   new_gpaddr, new_page_mfn);
    1.25 -                        goto out;
    1.26 +                        return GNTST_general_error;
    1.27                      }
    1.28                  }
    1.29                  domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 0);
    1.30 @@ -2246,7 +2246,7 @@ replace_grant_host_mapping(unsigned long
    1.31      if (pte == NULL) {
    1.32          gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx\n",
    1.33                  __func__, gpaddr, mfn);
    1.34 -        goto out;
    1.35 +        return GNTST_general_error;
    1.36      }
    1.37  
    1.38   again:
    1.39 @@ -2256,10 +2256,11 @@ replace_grant_host_mapping(unsigned long
    1.40          (page_get_owner(page) == d && get_gpfn_from_mfn(mfn) == gpfn)) {
    1.41          gdprintk(XENLOG_INFO, "%s: gpaddr 0x%lx mfn 0x%lx cur_pte 0x%lx\n",
    1.42                  __func__, gpaddr, mfn, pte_val(cur_pte));
    1.43 -        goto out;
    1.44 +        return GNTST_general_error;
    1.45      }
    1.46  
    1.47      if (new_page) {
    1.48 +        BUG_ON(new_page_mfn == INVALID_MFN);
    1.49          set_gpfn_from_mfn(new_page_mfn, gpfn);
    1.50          /* smp_mb() isn't needed because assign_domain_pge_cmpxchg_rel()
    1.51             has release semantics. */
    1.52 @@ -2270,6 +2271,7 @@ replace_grant_host_mapping(unsigned long
    1.53              goto again;
    1.54          }
    1.55          if (new_page) {
    1.56 +            BUG_ON(new_page_mfn == INVALID_MFN);
    1.57              set_gpfn_from_mfn(new_page_mfn, INVALID_M2P_ENTRY);
    1.58              domain_put_page(d, new_gpaddr, new_page_pte, new_pte, 1);
    1.59          }