With 4K pages there is exactly one HPTE per PTE, so
pte_iterate_hashed_subpages() only sets index and shift and does not
look at rpte at all, whereas 64K version reads all three.

Reference all variables in pte_iterate_hashed_subpages() even for the
4K version, to avoid -Wunused-but-set-variable warning.

No functional change.

Signed-off-by: Ritesh Harjani (IBM) <[email protected]>
---
 arch/powerpc/include/asm/book3s/64/hash-4k.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/include/asm/book3s/64/hash-4k.h 
b/arch/powerpc/include/asm/book3s/64/hash-4k.h
index 8e5bd9902bed..179181870e71 100644
--- a/arch/powerpc/include/asm/book3s/64/hash-4k.h
+++ b/arch/powerpc/include/asm/book3s/64/hash-4k.h
@@ -89,10 +89,14 @@ static inline unsigned long __rpte_to_hidx(real_pte_t rpte, 
unsigned long index)
        return pte_val(__rpte_to_pte(rpte)) >> H_PAGE_F_GIX_SHIFT;
 }
 
+/* references all variables to avoid -Wunused-but-set-variable warning */
 #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift)       \
        do {                                                             \
                index = 0;                                               \
                shift = mmu_psize_defs[psize].shift;                     \
+               (void)(rpte);                                            \
+               (void)(index);                                           \
+               (void)(shift);                                           \
 
 #define pte_iterate_hashed_end() } while(0)
 
-- 
2.39.5


Reply via email to