All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fixmap: use CONFIG_NR_CPUS instead of NR_CPUS
@ 2021-05-21 19:59 Randy Dunlap
  2021-05-26  6:50 ` Ingo Molnar
  0 siblings, 1 reply; 6+ messages in thread
From: Randy Dunlap @ 2021-05-21 19:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
	Mel Gorman

Use CONFIG_NR_CPUS instead of NR_CPUS for an enum entry item.
(Alternatively, #include <linux/threads.h> unconditionally instead of
conditionally.)

This fixes 100+ build errors like so:

In file included from ../include/asm-generic/early_ioremap.h:6:0,
                 from ./arch/x86/include/generated/asm/early_ioremap.h:1,
                 from ../arch/x86/include/asm/io.h:44,
                 from ../include/linux/io.h:13,
                 from ../mm/early_ioremap.c:13:
../arch/x86/include/asm/fixmap.h:103:48: error: ‘NR_CPUS’ undeclared here (not in a function); did you mean ‘NR_OPEN’?
  FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,

Fixes: e972c2511967 ("mm/early_ioremap: add prototype for early_memremap_pgprot_adjust")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Cc: Mel Gorman <mgorman@techsingularity.net>
---
 arch/x86/include/asm/fixmap.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-next-20210521.orig/arch/x86/include/asm/fixmap.h
+++ linux-next-20210521/arch/x86/include/asm/fixmap.h
@@ -100,7 +100,7 @@ enum fixed_addresses {
 #endif
 #ifdef CONFIG_KMAP_LOCAL
 	FIX_KMAP_BEGIN,	/* reserved pte's for temporary kernel mappings */
-	FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
+	FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * CONFIG_NR_CPUS) - 1,
 #ifdef CONFIG_PCI_MMCONFIG
 	FIX_PCIE_MCFG,
 #endif

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

end of thread, other threads:[~2021-05-27 16:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 19:59 [PATCH] x86: fixmap: use CONFIG_NR_CPUS instead of NR_CPUS Randy Dunlap
2021-05-26  6:50 ` Ingo Molnar
2021-05-26 17:59   ` Randy Dunlap
2021-05-27 13:53     ` Mel Gorman
2021-05-27 15:48       ` Randy Dunlap
2021-05-27 16:55         ` Mel Gorman

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.