tree 64c52d1e3f1ce58b178561f6d5815887b37a81ba
parent ce21795275ab469b97384faa36462350af17eca0
author Michael Ellerman <[EMAIL PROTECTED]> Wed, 03 Aug 2005 20:21:24 +1000
committer Paul Mackerras <[EMAIL PROTECTED]> Mon, 29 Aug 2005 10:53:36 +1000

[PATCH] ppc64: Remove redundant uses of physRpn_to_absRpn

physRpn_to_absRpn is a no-op on non-iSeries platforms, remove the two
redundant calls.

There's only one caller on iSeries so fold the logic in there so we can get
rid of it completely.

Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>

 arch/ppc64/kernel/iSeries_htab.c |    5 ++++-
 arch/ppc64/kernel/pSeries_lpar.c |    3 +--
 arch/ppc64/mm/hash_native.c      |    3 +--
 include/asm-ppc64/abs_addr.h     |    8 --------
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/arch/ppc64/kernel/iSeries_htab.c b/arch/ppc64/kernel/iSeries_htab.c
--- a/arch/ppc64/kernel/iSeries_htab.c
+++ b/arch/ppc64/kernel/iSeries_htab.c
@@ -41,6 +41,7 @@ static long iSeries_hpte_insert(unsigned
                                unsigned long prpn, unsigned long vflags,
                                unsigned long rflags)
 {
+       unsigned long arpn;
        long slot;
        hpte_t lhpte;
        int secondary = 0;
@@ -70,8 +71,10 @@ static long iSeries_hpte_insert(unsigned
                slot &= 0x7fffffffffffffff;
        }
 
+       arpn = phys_to_abs(prpn << PAGE_SHIFT) >> PAGE_SHIFT;
+
        lhpte.v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
-       lhpte.r = (physRpn_to_absRpn(prpn) << HPTE_R_RPN_SHIFT) | rflags;
+       lhpte.r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
 
        /* Now fill in the actual HPTE */
        HvCallHpt_addValidate(slot, secondary, &lhpte);
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/ppc64/kernel/pSeries_lpar.c
@@ -278,7 +278,6 @@ long pSeries_lpar_hpte_insert(unsigned l
                              unsigned long va, unsigned long prpn,
                              unsigned long vflags, unsigned long rflags)
 {
-       unsigned long arpn = physRpn_to_absRpn(prpn);
        unsigned long lpar_rc;
        unsigned long flags;
        unsigned long slot;
@@ -289,7 +288,7 @@ long pSeries_lpar_hpte_insert(unsigned l
        if (vflags & HPTE_V_LARGE)
                hpte_v &= ~(1UL << HPTE_V_AVPN_SHIFT);
 
-       hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
+       hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
 
        /* Now fill in the actual HPTE */
        /* Set CEC cookie to 0         */
diff --git a/arch/ppc64/mm/hash_native.c b/arch/ppc64/mm/hash_native.c
--- a/arch/ppc64/mm/hash_native.c
+++ b/arch/ppc64/mm/hash_native.c
@@ -51,7 +51,6 @@ long native_hpte_insert(unsigned long hp
                        unsigned long prpn, unsigned long vflags,
                        unsigned long rflags)
 {
-       unsigned long arpn = physRpn_to_absRpn(prpn);
        hpte_t *hptep = htab_address + hpte_group;
        unsigned long hpte_v, hpte_r;
        int i;
@@ -74,7 +73,7 @@ long native_hpte_insert(unsigned long hp
        hpte_v = (va >> 23) << HPTE_V_AVPN_SHIFT | vflags | HPTE_V_VALID;
        if (vflags & HPTE_V_LARGE)
                va &= ~(1UL << HPTE_V_AVPN_SHIFT);
-       hpte_r = (arpn << HPTE_R_RPN_SHIFT) | rflags;
+       hpte_r = (prpn << HPTE_R_RPN_SHIFT) | rflags;
 
        hptep->r = hpte_r;
        /* Guarantee the second dword is visible before the valid bit */
diff --git a/include/asm-ppc64/abs_addr.h b/include/asm-ppc64/abs_addr.h
--- a/include/asm-ppc64/abs_addr.h
+++ b/include/asm-ppc64/abs_addr.h
@@ -56,14 +56,6 @@ static inline unsigned long phys_to_abs(
        return chunk_to_addr(chunk) + (pa & MSCHUNKS_OFFSET_MASK);
 }
 
-static inline unsigned long
-physRpn_to_absRpn(unsigned long rpn)
-{
-       unsigned long pa = rpn << PAGE_SHIFT;
-       unsigned long aa = phys_to_abs(pa);
-       return (aa >> PAGE_SHIFT);
-}
-
 /* A macro so it can take pointers or unsigned long. */
 #define abs_to_phys(aa) lmb_abs_to_phys((unsigned long)(aa))
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to