]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
KVM: PPC: Book3s HV: Fix tlbie compile error
authorAlexander Graf <agraf@suse.de>
Wed, 11 Jun 2014 15:13:55 +0000 (17:13 +0200)
committerAlexander Graf <agraf@suse.de>
Mon, 28 Jul 2014 13:22:12 +0000 (15:22 +0200)
Some compilers complain about uninitialized variables in the compute_tlbie_rb
function. When you follow the code path you'll realize that we'll never get
to that point, but the compiler isn't all that smart.

So just default to 4k page sizes for everything, making the compiler happy
and the code slightly easier to read.

Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/include/asm/kvm_book3s_64.h

index fddb72b48ce9bd2a9a4e25460c2ff5cc4bc15ad5..c7871f314539a68d04067a4990b3c8712aa6d26f 100644 (file)
@@ -110,16 +110,12 @@ static inline int __hpte_actual_psize(unsigned int lp, int psize)
 static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
                                             unsigned long pte_index)
 {
-       int b_psize, a_psize;
+       int b_psize = MMU_PAGE_4K, a_psize = MMU_PAGE_4K;
        unsigned int penc;
        unsigned long rb = 0, va_low, sllp;
        unsigned int lp = (r >> LP_SHIFT) & ((1 << LP_BITS) - 1);
 
-       if (!(v & HPTE_V_LARGE)) {
-               /* both base and actual psize is 4k */
-               b_psize = MMU_PAGE_4K;
-               a_psize = MMU_PAGE_4K;
-       } else {
+       if (v & HPTE_V_LARGE) {
                for (b_psize = 0; b_psize < MMU_PAGE_COUNT; b_psize++) {
 
                        /* valid entries have a shift value */