mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues
@ 2026-10-16 10:09 Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-10-16 10:09 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Tianrui Zhao, Bibo Mao, Huacai Chen, WANG Xuerui, Nicolas Schier,
	Armin Wolf, Geert Uytterhoeven, Takashi Sakamoto,
	Heiner Kallweit, Greg Kroah-Hartman, Raag Jadav, Dave Hansen,
	Jose Javier Rodriguez Barbarin, Andy Shevchenko, Ingo Molnar,
	Josh Poimboeuf, Ilpo Järvinen, Hasan Basbunar, kvm,
	loongarch, linux-kernel, linux-kbuild

Hello,

v1 of this series is available from
https://lore.kernel.org/lkml/cover.1789988540.git.u.kleine-koenig@baylibre.com/

Changes since then are:

 - rebase to v7.3-rc7
 - Add a header guard and a comment about why it's necessary
 - Add Acked-by: for Armin Wolf

Nathan identified two merge conflicts for v1 with commits in next. These
still happen and are easy to resolve as soon as the respective branches
are merged into a common tree.

Nathan already proposed to take this series via the Kbuild tree after
letting it cook in next after the upcomming merge window closes.

Uwe Kleine-König (The Capable Hub) (3):
  Move struct cpu_feature to <linux/cpufeature.h>
  devicetable-offsets: Include the needed device-id headers instead of
    the catch-all
  file2alias: Include the needed device-id headers instead of the
    catch-all

Best regards
Uwe

 arch/loongarch/kvm/main.c         |  2 +-
 include/linux/cpufeature.h        | 19 ++++++++++-
 include/linux/mod_devicetable.h   | 13 -------
 scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
 scripts/mod/file2alias.c          | 56 +++++++++++++++++++++++++++++-
 5 files changed, 130 insertions(+), 17 deletions(-)


base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
-- 
2.56.0.rc1


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

* [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h>
  2026-10-16 10:09 [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
@ 2026-10-16 10:09 ` Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-10-16 10:09 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Tianrui Zhao, Bibo Mao, Huacai Chen, WANG Xuerui, Nicolas Schier,
	Armin Wolf, Geert Uytterhoeven, Takashi Sakamoto,
	Heiner Kallweit, Greg Kroah-Hartman, Raag Jadav, Dave Hansen,
	Jose Javier Rodriguez Barbarin, Andy Shevchenko, Ingo Molnar,
	Josh Poimboeuf, Ilpo Järvinen, Hasan Basbunar, kvm,
	loongarch, linux-kernel, linux-kbuild

struct cpu_feature used to be defined in <linux/mod_devicetable.h>. It's
much better located in <linux/cpufeature.h>. The only downside is that
modpost and devicetable-offsets.h need the definition and thus
<linux/cpufeature.h> must be included explicitly there.

Acked-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 arch/loongarch/kvm/main.c         |  2 +-
 include/linux/cpufeature.h        | 19 ++++++++++++++++++-
 include/linux/mod_devicetable.h   | 13 -------------
 scripts/mod/devicetable-offsets.c |  1 +
 scripts/mod/file2alias.c          |  1 +
 5 files changed, 21 insertions(+), 15 deletions(-)

diff --git a/arch/loongarch/kvm/main.c b/arch/loongarch/kvm/main.c
index 236523d2449d..d082dae61971 100644
--- a/arch/loongarch/kvm/main.c
+++ b/arch/loongarch/kvm/main.c
@@ -5,7 +5,7 @@
 
 #include <linux/err.h>
 #include <linux/module.h>
-#include <linux/mod_devicetable.h>
+#include <linux/cpufeature.h>
 #include <linux/kvm_host.h>
 #include <asm/cacheflush.h>
 #include <asm/cpufeature.h>
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h
index 6aff540ee9e5..7b22a536542d 100644
--- a/include/linux/cpufeature.h
+++ b/include/linux/cpufeature.h
@@ -6,10 +6,27 @@
 #ifndef __LINUX_CPUFEATURE_H
 #define __LINUX_CPUFEATURE_H
 
+/*
+ * This file is included by scripts/mod/file2alias.c which is compiled
+ * using the host compiler which might not have <linux/types.h> but the
+ * __u{8,16,32} types are defined there locally.
+ */
+#ifdef __KERNEL__
+#include <linux/types.h>
+#endif
+
+/*
+ * Generic table type for matching CPU features.
+ * @feature:	the bit number of the feature (0 - 65535)
+ */
+
+struct cpu_feature {
+	__u16	feature;
+};
+
 #ifdef CONFIG_GENERIC_CPU_AUTOPROBE
 
 #include <linux/init.h>
-#include <linux/mod_devicetable.h>
 #include <asm/cpufeature.h>
 
 /*
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index a397213bedac..9ce2429b455f 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -8,10 +8,6 @@
 #ifndef LINUX_MOD_DEVICETABLE_H
 #define LINUX_MOD_DEVICETABLE_H
 
-#ifdef __KERNEL__
-#include <linux/types.h>
-#endif
-
 #include "device-id/acpi.h"
 #include "device-id/amba.h"
 #include "device-id/ap.h"
@@ -69,13 +65,4 @@
 #include "device-id/x86_cpu.h"
 #include "device-id/zorro.h"
 
-/*
- * Generic table type for matching CPU features.
- * @feature:	the bit number of the feature (0 - 65535)
- */
-
-struct cpu_feature {
-	__u16	feature;
-};
-
 #endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index b4178c42d08f..b57dbbef8777 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #define COMPILE_OFFSETS
+#include <linux/cpufeature.h>
 #include <linux/kbuild.h>
 #include <linux/mod_devicetable.h>
 
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 8d36c74dec2d..88bff3207277 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -121,6 +121,7 @@ typedef struct {
 /* Big exception to the "don't include kernel headers into userspace, which
  * even potentially has different endianness and word sizes, since
  * we handle those differences explicitly below */
+#include "../../include/linux/cpufeature.h"
 #include "../../include/linux/mod_devicetable.h"
 
 struct devtable {
-- 
2.56.0.rc1


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

* [PATCH v2 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all
  2026-10-16 10:09 [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
@ 2026-10-16 10:09 ` Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-10-16 10:09 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nicolas Schier, Armin Wolf, Andy Shevchenko, Josh Poimboeuf,
	Ingo Molnar, Jose Javier Rodriguez Barbarin, linux-kbuild,
	linux-kernel

<linux/mod_devicetable.h> is planned to go away. Include just the needed
bits in scripts/mod/devicetable-offsets.c which reduces dependencies as
<linux/mod_devicetable.h> includes several headers not needed here.

Acked-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 scripts/mod/devicetable-offsets.c | 56 ++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index b57dbbef8777..1f4bbd014a3d 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -2,7 +2,61 @@
 #define COMPILE_OFFSETS
 #include <linux/cpufeature.h>
 #include <linux/kbuild.h>
-#include <linux/mod_devicetable.h>
+
+#include <linux/device-id/acpi.h>
+#include <linux/device-id/amba.h>
+#include <linux/device-id/ap.h>
+#include <linux/device-id/auxiliary.h>
+#include <linux/device-id/bcma.h>
+#include <linux/device-id/ccw.h>
+#include <linux/device-id/cdx.h>
+#include <linux/device-id/coreboot.h>
+#include <linux/device-id/css.h>
+#include <linux/device-id/dfl.h>
+#include <linux/device-id/dmi.h>
+#include <linux/device-id/eisa.h>
+#include <linux/device-id/fsl_mc.h>
+#include <linux/device-id/hda.h>
+#include <linux/device-id/hid.h>
+#include <linux/device-id/hv_vmbus.h>
+#include <linux/device-id/i2c.h>
+#include <linux/device-id/i3c.h>
+#include <linux/device-id/ieee1394.h>
+#include <linux/device-id/input.h>
+#include <linux/device-id/ipack.h>
+#include <linux/device-id/isapnp.h>
+#include <linux/device-id/ishtp.h>
+#include <linux/device-id/mcb.h>
+#include <linux/device-id/mdio.h>
+#include <linux/device-id/mei_cl.h>
+#include <linux/device-id/mhi.h>
+#include <linux/device-id/mips_cdmm.h>
+#include <linux/device-id/of.h>
+#include <linux/device-id/parisc.h>
+#include <linux/device-id/pci.h>
+#include <linux/device-id/pcmcia.h>
+#include <linux/device-id/platform.h>
+#include <linux/device-id/pnp.h>
+#include <linux/device-id/rio.h>
+#include <linux/device-id/rpmsg.h>
+#include <linux/device-id/sdio.h>
+#include <linux/device-id/sdw.h>
+#include <linux/device-id/serio.h>
+#include <linux/device-id/slim.h>
+#include <linux/device-id/spi.h>
+#include <linux/device-id/ssam.h>
+#include <linux/device-id/ssb.h>
+#include <linux/device-id/tb.h>
+#include <linux/device-id/tee_client.h>
+#include <linux/device-id/typec.h>
+#include <linux/device-id/ulpi.h>
+#include <linux/device-id/usb.h>
+#include <linux/device-id/vchiq.h>
+#include <linux/device-id/vio.h>
+#include <linux/device-id/virtio.h>
+#include <linux/device-id/wmi.h>
+#include <linux/device-id/x86_cpu.h>
+#include <linux/device-id/zorro.h>
 
 #define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
 #define DEVID_FIELD(devid, field) \
-- 
2.56.0.rc1


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

* [PATCH v2 3/3] file2alias: Include the needed device-id headers instead of the catch-all
  2026-10-16 10:09 [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
  2026-10-16 10:09 ` [PATCH v2 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
@ 2026-10-16 10:09 ` Uwe Kleine-König (The Capable Hub)
  2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-10-16 10:09 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Nicolas Schier, Armin Wolf, Ilpo Järvinen, Andy Shevchenko,
	Jose Javier Rodriguez Barbarin, Hasan Basbunar, linux-kbuild,
	linux-kernel

<linux/mod_devicetable.h> is planned to go away. Include just the needed
bits in scripts/mod/file2alias.c which reduces dependencies as
<linux/mod_devicetable.h> includes several headers not needed here.

Acked-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
 scripts/mod/file2alias.c | 55 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 54 insertions(+), 1 deletion(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 88bff3207277..7d76233a8d5d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -122,7 +122,60 @@ typedef struct {
  * even potentially has different endianness and word sizes, since
  * we handle those differences explicitly below */
 #include "../../include/linux/cpufeature.h"
-#include "../../include/linux/mod_devicetable.h"
+#include "../../include/linux/device-id/acpi.h"
+#include "../../include/linux/device-id/amba.h"
+#include "../../include/linux/device-id/ap.h"
+#include "../../include/linux/device-id/auxiliary.h"
+#include "../../include/linux/device-id/bcma.h"
+#include "../../include/linux/device-id/ccw.h"
+#include "../../include/linux/device-id/cdx.h"
+#include "../../include/linux/device-id/coreboot.h"
+#include "../../include/linux/device-id/css.h"
+#include "../../include/linux/device-id/dfl.h"
+#include "../../include/linux/device-id/dmi.h"
+#include "../../include/linux/device-id/eisa.h"
+#include "../../include/linux/device-id/fsl_mc.h"
+#include "../../include/linux/device-id/hda.h"
+#include "../../include/linux/device-id/hid.h"
+#include "../../include/linux/device-id/hv_vmbus.h"
+#include "../../include/linux/device-id/i2c.h"
+#include "../../include/linux/device-id/i3c.h"
+#include "../../include/linux/device-id/ieee1394.h"
+#include "../../include/linux/device-id/input.h"
+#include "../../include/linux/device-id/ipack.h"
+#include "../../include/linux/device-id/isapnp.h"
+#include "../../include/linux/device-id/ishtp.h"
+#include "../../include/linux/device-id/mcb.h"
+#include "../../include/linux/device-id/mdio.h"
+#include "../../include/linux/device-id/mei_cl.h"
+#include "../../include/linux/device-id/mhi.h"
+#include "../../include/linux/device-id/mips_cdmm.h"
+#include "../../include/linux/device-id/of.h"
+#include "../../include/linux/device-id/parisc.h"
+#include "../../include/linux/device-id/pci.h"
+#include "../../include/linux/device-id/pcmcia.h"
+#include "../../include/linux/device-id/platform.h"
+#include "../../include/linux/device-id/pnp.h"
+#include "../../include/linux/device-id/rio.h"
+#include "../../include/linux/device-id/rpmsg.h"
+#include "../../include/linux/device-id/sdio.h"
+#include "../../include/linux/device-id/sdw.h"
+#include "../../include/linux/device-id/serio.h"
+#include "../../include/linux/device-id/slim.h"
+#include "../../include/linux/device-id/spi.h"
+#include "../../include/linux/device-id/ssam.h"
+#include "../../include/linux/device-id/ssb.h"
+#include "../../include/linux/device-id/tb.h"
+#include "../../include/linux/device-id/tee_client.h"
+#include "../../include/linux/device-id/typec.h"
+#include "../../include/linux/device-id/ulpi.h"
+#include "../../include/linux/device-id/usb.h"
+#include "../../include/linux/device-id/vchiq.h"
+#include "../../include/linux/device-id/vio.h"
+#include "../../include/linux/device-id/virtio.h"
+#include "../../include/linux/device-id/wmi.h"
+#include "../../include/linux/device-id/x86_cpu.h"
+#include "../../include/linux/device-id/zorro.h"
 
 struct devtable {
 	const char *device_id;
-- 
2.56.0.rc1


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

end of thread, other threads:[~2026-10-16 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 10:09 [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-10-16 10:09 ` [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
2026-10-16 10:09 ` [PATCH v2 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
2026-10-16 10:09 ` [PATCH v2 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®