提交 f6bf3a66 编写于 作者: A Alexander Graf

KVM: PPC: Book3s HV: Fix tlbie compile error

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: NAlexander Graf <agraf@suse.de>
Acked-by: NPaul Mackerras <paulus@samba.org>
上级 fb4188ba
...@@ -110,16 +110,12 @@ static inline int __hpte_actual_psize(unsigned int lp, int psize) ...@@ -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, static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r,
unsigned long pte_index) unsigned long pte_index)
{ {
int b_psize, a_psize; int b_psize = MMU_PAGE_4K, a_psize = MMU_PAGE_4K;
unsigned int penc; unsigned int penc;
unsigned long rb = 0, va_low, sllp; unsigned long rb = 0, va_low, sllp;
unsigned int lp = (r >> LP_SHIFT) & ((1 << LP_BITS) - 1); unsigned int lp = (r >> LP_SHIFT) & ((1 << LP_BITS) - 1);
if (!(v & HPTE_V_LARGE)) { if (v & HPTE_V_LARGE) {
/* both base and actual psize is 4k */
b_psize = MMU_PAGE_4K;
a_psize = MMU_PAGE_4K;
} else {
for (b_psize = 0; b_psize < MMU_PAGE_COUNT; b_psize++) { for (b_psize = 0; b_psize < MMU_PAGE_COUNT; b_psize++) {
/* valid entries have a shift value */ /* valid entries have a shift value */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册