]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 19 Feb 2021 16:56:48 +0000 (17:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:01 +0000 (10:50 +0200)
[ Upstream commit 9be77e11dade414d2fa63750aa5c754fac49d619 ]

The mutex linear_mapping_mutex is defined at the of the file while its
only two user are within the CONFIG_MEMORY_HOTPLUG block.
A compile without CONFIG_MEMORY_HOTPLUG set fails on PREEMPT_RT because
its mutex implementation is smart enough to realize that it is unused.

Move the definition of linear_mapping_mutex to ifdef block where it is
used.

Fixes: 1f73ad3e8d755 ("powerpc/mm: print warning in arch_remove_linear_mapping()")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210219165648.2505482-1-bigeasy@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/mm/mem.c

index afab328d088740fdbe454d4f9d53737fea1371c0..d6c3f0b79f1d15cacbaf6c12f88a276c441ef964 100644 (file)
@@ -54,7 +54,6 @@
 
 #include <mm/mmu_decl.h>
 
-static DEFINE_MUTEX(linear_mapping_mutex);
 unsigned long long memory_limit;
 bool init_mem_is_free;
 
@@ -72,6 +71,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 EXPORT_SYMBOL(phys_mem_access_prot);
 
 #ifdef CONFIG_MEMORY_HOTPLUG
+static DEFINE_MUTEX(linear_mapping_mutex);
 
 #ifdef CONFIG_NUMA
 int memory_add_physaddr_to_nid(u64 start)