Re: [PATCH] x86: fixmap: use CONFIG_NR_CPUS instead of NR_CPUS

From: Mel Gorman
Date: Thu May 27 2021 - 09:53:35 EST


On Wed, May 26, 2021 at 10:59:51AM -0700, Randy Dunlap wrote:
> > - Once early_ioremap.h is gone from io.h, it's potentially possible to
> > include <linux/threads.h>. More work to resolve dependencies might be
> > needed though.
>
> Yes, my first patch for this (unsent) just included <linux/threads.h>
> in fixmap.h unconditionally instead of conditionally.
>
> > Frankly, I'd prefer if such a low level header dependencies change came in
> > via the x86 tree so we can properly review it, test it, and keep it
> > working. Right now I can only guess what is needed here...
>
> Sure, makes sense.
>
> Mel, do you have any patch suggestions here? re:

For whatever reason, I do not see the same build warnings you report.

Dropping "mm/early_ioremap: add prototype for early_memremap_pgprot_adjust"
is one option. Alternatively, this should also work and it's a more
sensible dependency.

diff --git a/include/asm-generic/early_ioremap.h b/include/asm-generic/early_ioremap.h
index 022f8f908b42..d95c693de640 100644
--- a/include/asm-generic/early_ioremap.h
+++ b/include/asm-generic/early_ioremap.h
@@ -3,7 +3,7 @@
#define _ASM_EARLY_IOREMAP_H_

#include <linux/types.h>
-#include <asm/fixmap.h>
+#include <linux/pgtable.h>

/*
* early_ioremap() and early_iounmap() are for temporary early boot-time

--
Mel Gorman
SUSE Labs