summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/init-common.c
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-11-29 15:07:09 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-04 09:45:01 +0100
commit32bff4b9053193303b4dd4c5498a1ffc6b23bb2f (patch)
tree2aff70e3823e4cd896668a3c30ad173ee458ff99 /arch/powerpc/mm/init-common.c
parentpowerpc/mm: fix a warning when a cache is common to PGD and hugepages (diff)
downloadlinux-32bff4b9053193303b4dd4c5498a1ffc6b23bb2f.tar.xz
linux-32bff4b9053193303b4dd4c5498a1ffc6b23bb2f.zip
powerpc/mm: remove unnecessary test in pgtable_cache_init()
pgtable_cache_add() gracefully handles the case when a cache that size already exists by returning early with the following test: if (PGT_CACHE(shift)) return; /* Already have a cache of this size */ It is then not needed to test the existence of the cache before. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/init-common.c')
-rw-r--r--arch/powerpc/mm/init-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/init-common.c b/arch/powerpc/mm/init-common.c
index b7ca03643d0b..1e6910eb70ed 100644
--- a/arch/powerpc/mm/init-common.c
+++ b/arch/powerpc/mm/init-common.c
@@ -111,13 +111,13 @@ void pgtable_cache_init(void)
{
pgtable_cache_add(PGD_INDEX_SIZE);
- if (PMD_CACHE_INDEX && !PGT_CACHE(PMD_CACHE_INDEX))
+ if (PMD_CACHE_INDEX)
pgtable_cache_add(PMD_CACHE_INDEX);
/*
* In all current configs, when the PUD index exists it's the
* same size as either the pgd or pmd index except with THP enabled
* on book3s 64
*/
- if (PUD_CACHE_INDEX && !PGT_CACHE(PUD_CACHE_INDEX))
+ if (PUD_CACHE_INDEX)
pgtable_cache_add(PUD_CACHE_INDEX);
}