]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sparc32: use PUD rather than PGD to get PMD in srmmu_nocache_init()
authorMike Rapoport <rppt@linux.ibm.com>
Sat, 23 May 2020 05:23:09 +0000 (22:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 May 2020 17:26:32 +0000 (10:26 -0700)
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: ff4daf22041b5ce4a6 ("sparc32: use pgtable-nopud instead of 4level-fixup")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Anatoly Pugachev <matorola@gmail.com>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/r/20200520132005.GM1059226@linux.ibm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/sparc/mm/srmmu.c

index b7c94de70ccac87bdb31f4c4366b86b9ac281df3..e9f7af32da0772f979cde5c212252ca7873ee919 100644 (file)
@@ -333,7 +333,7 @@ static void __init srmmu_nocache_init(void)
                pgd = pgd_offset_k(vaddr);
                p4d = p4d_offset(__nocache_fix(pgd), vaddr);
                pud = pud_offset(__nocache_fix(p4d), vaddr);
-               pmd = pmd_offset(__nocache_fix(pgd), vaddr);
+               pmd = pmd_offset(__nocache_fix(pud), vaddr);
                pte = pte_offset_kernel(__nocache_fix(pmd), vaddr);
 
                pteval = ((paddr >> 4) | SRMMU_ET_PTE | SRMMU_PRIV);