powerpc: Remove impossible mmu_psize_defs[] on nohash
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Mon, 19 Sep 2022 17:01:43 +0000 (19:01 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 26 Sep 2022 13:00:14 +0000 (23:00 +1000)
Today there is:

  if e500 or 8xx
    if e500
      mmu_psize_defs[] =
    else if 8xx
      mmu_psize_defs[] =
    else
      mmu_psize_defs[] =
    endif
  endif

The else leg is dead definition.

Drop that else leg and rewrite as:

  if e500
    mmu_psize_defs[] =
  endif
  if 8xx
    mmu_psize_defs[] =
  endif

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/030a843449f348c0b709ca5349640624f36a016f.1663606876.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/nohash/tlb.c

index fac59fb..2c15c86 100644 (file)
@@ -49,7 +49,6 @@
  * other sizes not listed here.   The .ind field is only used on MMUs that have
  * indirect page table entries.
  */
-#if defined(CONFIG_PPC_E500) || defined(CONFIG_PPC_8xx)
 #ifdef CONFIG_PPC_E500
 struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
        [MMU_PAGE_4K] = {
@@ -81,7 +80,20 @@ struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
                .enc    = BOOK3E_PAGESZ_1GB,
        },
 };
-#elif defined(CONFIG_PPC_8xx)
+
+static inline int mmu_get_tsize(int psize)
+{
+       return mmu_psize_defs[psize].enc;
+}
+#else
+static inline int mmu_get_tsize(int psize)
+{
+       /* This isn't used on !Book3E for now */
+       return 0;
+}
+#endif
+
+#ifdef CONFIG_PPC_8xx
 struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
        [MMU_PAGE_4K] = {
                .shift  = 12,
@@ -96,53 +108,7 @@ struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
                .shift  = 23,
        },
 };
-#else
-struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT] = {
-       [MMU_PAGE_4K] = {
-               .shift  = 12,
-               .ind    = 20,
-               .enc    = BOOK3E_PAGESZ_4K,
-       },
-       [MMU_PAGE_16K] = {
-               .shift  = 14,
-               .enc    = BOOK3E_PAGESZ_16K,
-       },
-       [MMU_PAGE_64K] = {
-               .shift  = 16,
-               .ind    = 28,
-               .enc    = BOOK3E_PAGESZ_64K,
-       },
-       [MMU_PAGE_1M] = {
-               .shift  = 20,
-               .enc    = BOOK3E_PAGESZ_1M,
-       },
-       [MMU_PAGE_16M] = {
-               .shift  = 24,
-               .ind    = 36,
-               .enc    = BOOK3E_PAGESZ_16M,
-       },
-       [MMU_PAGE_256M] = {
-               .shift  = 28,
-               .enc    = BOOK3E_PAGESZ_256M,
-       },
-       [MMU_PAGE_1G] = {
-               .shift  = 30,
-               .enc    = BOOK3E_PAGESZ_1GB,
-       },
-};
-#endif /* CONFIG_PPC_85xx */
-
-static inline int mmu_get_tsize(int psize)
-{
-       return mmu_psize_defs[psize].enc;
-}
-#else
-static inline int mmu_get_tsize(int psize)
-{
-       /* This isn't used on !Book3E for now */
-       return 0;
-}
-#endif /* CONFIG_PPC_E500 */
+#endif
 
 /* The variables below are currently only used on 64-bit Book3E
  * though this will probably be made common with other nohash