All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
@ 2021-02-19 16:56 Sebastian Andrzej Siewior
  2021-03-31  1:09 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-02-19 16:56 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Thomas Gleixner, Paul Mackerras, Sebastian Andrzej Siewior

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>
---
 arch/powerpc/mm/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index afab328d08874..d6c3f0b79f1d1 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -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)
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
  2021-02-19 16:56 [PATCH] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used Sebastian Andrzej Siewior
@ 2021-03-31  1:09 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2021-03-31  1:09 UTC (permalink / raw)
  To: linuxppc-dev, Sebastian Andrzej Siewior; +Cc: Thomas Gleixner, Paul Mackerras

On Fri, 19 Feb 2021 17:56:48 +0100, Sebastian Andrzej Siewior wrote:
> 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.

Applied to powerpc/next.

[1/1] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used
      https://git.kernel.org/powerpc/c/9be77e11dade414d2fa63750aa5c754fac49d619

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-31  1:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 16:56 [PATCH] powerpc/mm: Move the linear_mapping_mutex to the ifdef where it is used Sebastian Andrzej Siewior
2021-03-31  1:09 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.