Skip to content

Commit c2bc26f

Browse files
rppttorvalds
authored andcommitted
sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()
The kbuild test robot reported the following warning: arch/sparc/mm/srmmu.c: In function 'srmmu_nocache_init': arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used [-Werror=unused-but-set-variable] 300 | pud_t *pud; This warning is caused by misprint in the page table traversal in srmmu_nocache_init() function which accessed a PMD entry using PGD rather than PUD. Since sparc32 has only 3 page table levels, the PGD and PUD are essentially the same and usage of __nocache_fix() removed the type checking. Use PUD for the consistency and to silence the compiler warning. Fixes: 7235db2 ("sparc32: use pgtable-nopud instead of 4level-fixup") Reported-by: kbuild test robot <[email protected]> Signed-off-by: Mike Rapoport <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: David S. Miller <[email protected]> Cc: Anatoly Pugachev <[email protected]> Cc: <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent f7fa187 commit c2bc26f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/sparc/mm/srmmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static void __init srmmu_nocache_init(void)
333333
pgd = pgd_offset_k(vaddr);
334334
p4d = p4d_offset(__nocache_fix(pgd), vaddr);
335335
pud = pud_offset(__nocache_fix(p4d), vaddr);
336-
pmd = pmd_offset(__nocache_fix(pgd), vaddr);
336+
pmd = pmd_offset(__nocache_fix(pud), vaddr);
337337
pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
338338

339339
pteval = ((paddr >> 4) | SRMMU_ET_PTE | SRMMU_PRIV);

0 commit comments

Comments
 (0)