Skip to contentSkip to conversation

powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT

PATCH Applied Mathieu Malaterre 2 participants 2 messages Mar 22, 2018 – Apr 3, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT

In commit 9690c1574268 ("powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT") an issue was discovered where mm->context.id was being truncated to an unsigned int, while the PID is actually an unsigned long. Update the earlier patch by fixing one remaining occurrence. Discovered during a compilation with W=1:

arch/powerpc/mm/tlb-radix.c:702:19: error: comparison is always false due to limited range of data type [-Werror=type-limits]

---
 arch/powerpc/mm/tlb-radix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/tlb-radix.c +1 -1
index f6d61a75e739..f2d27d61ec48 100644
@@ -697,7 +697,7 @@ void radix__flush_tlb_pte_p9_dd1(unsigned long old_pte, struct mm_struct *mm,
 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
 extern void radix_kvm_prefetch_workaround(struct mm_struct *mm)
 {
-	unsigned int pid = mm->context.id;
+	unsigned long pid = mm->context.id;
 
 	if (unlikely(pid == MMU_NO_CONTEXT))
 		return;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 9 lines · Mathieu Malaterre

In commit 9690c1574268 ("powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT") an issue was discovered where mm->context.id was being truncated to an unsigned int, while the PID is actually an unsigned long. Update the earlier patch by fixing one remaining occurrence. Discovered during a compilation with W=1:

arch/powerpc/mm/tlb-radix.c:702:19: error: comparison is always false due to limited range of data type [-Werror=type-limits]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/19e68b2aec3c0a2bd770d3c358a296

cheers