* [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h>
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Uwe Kleine-König (The Capable Hub),
Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins, Armin Wolf
Cc: WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild, Sudeep Holla
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.
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 | 12 +++++++++++-
include/linux/mod_devicetable.h | 13 -------------
scripts/mod/devicetable-offsets.c | 1 +
scripts/mod/file2alias.c | 1 +
5 files changed, 14 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..93c1da38aaf6 100644
--- a/include/linux/cpufeature.h
+++ b/include/linux/cpufeature.h
@@ -6,10 +6,20 @@
#ifndef __LINUX_CPUFEATURE_H
#define __LINUX_CPUFEATURE_H
+#include <linux/types.h>
+
+/*
+ * 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] 7+ messages in thread* [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier,
Uwe Kleine-König (The Capable Hub),
Jorge Sanjuan Garcia, Jose Javier Rodriguez Barbarin,
Josh Poimboeuf
Cc: linux-kbuild, linux-kernel, Sudeep Holla
<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.
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] 7+ messages in thread* [PATCH v1 3/3] file2alias: Include the needed device-id headers instead of the catch-all
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 1/3] Move struct cpu_feature to <linux/cpufeature.h> Uwe Kleine-König (The Capable Hub)
2026-09-21 14:18 ` [PATCH v1 2/3] devicetable-offsets: Include the needed device-id headers instead of the catch-all Uwe Kleine-König (The Capable Hub)
@ 2026-09-21 14:18 ` Uwe Kleine-König (The Capable Hub)
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
2026-10-05 15:23 ` Nathan Chancellor
4 siblings, 0 replies; 7+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-09-21 14:18 UTC (permalink / raw)
To: Nathan Chancellor, Nicolas Schier, Alexey Gladkov,
Uwe Kleine-König (The Capable Hub),
Ilpo Järvinen, Armin Wolf, Hugh Dickins,
Jose Javier Rodriguez Barbarin, Hasan Basbunar
Cc: linux-kbuild, linux-kernel, Sudeep Holla
<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.
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] 7+ messages in thread* Re: [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-09-21 14:18 ` [PATCH v1 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
@ 2026-09-22 19:43 ` Armin Wolf
2026-10-05 15:23 ` Nathan Chancellor
4 siblings, 0 replies; 7+ messages in thread
From: Armin Wolf @ 2026-09-22 19:43 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub),
Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins
Cc: WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild, Sudeep Holla
Am 21.09.26 um 16:18 schrieb Uwe Kleine-König (The Capable Hub):
> Hello,
>
> this is a next step in the deprecation of <linux/mod_devicetable.h>.
> scripts/mod/devicetable-offsets.c and scripts/mod/file2alias.c are the
> only users of that header that use more than a few device-id structs. So
> their number of lines actually grows when unfolding the needed includes
> into them. Still it is a reduction in build dependencies.
>
> I suggest to take this via kbuild during the merge window. Would be great to
> cook in next for a while before.
>
> Best regards
> Uwe
Acked-by: Armin Wolf <W_Armin@gmx.de>
>
> 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
>
> arch/loongarch/kvm/main.c | 2 +-
> include/linux/cpufeature.h | 12 ++++++-
> include/linux/mod_devicetable.h | 13 -------
> scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
> scripts/mod/file2alias.c | 56 +++++++++++++++++++++++++++++-
> 5 files changed, 123 insertions(+), 17 deletions(-)
>
>
> base-commit: 93f51579e7df248780214094418f205253383cc5
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues
2026-09-21 14:18 [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
` (3 preceding siblings ...)
2026-09-22 19:43 ` [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues Armin Wolf
@ 2026-10-05 15:23 ` Nathan Chancellor
2026-10-06 8:54 ` Nathan Chancellor
4 siblings, 1 reply; 7+ messages in thread
From: Nathan Chancellor @ 2026-10-05 15:23 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Tianrui Zhao, Bibo Mao, Huacai Chen, Nathan Chancellor,
Nicolas Schier, Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins, Armin Wolf,
WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild,
Sudeep Holla
Hi Uwe,
> this is a next step in the deprecation of <linux/mod_devicetable.h>.
> scripts/mod/devicetable-offsets.c and scripts/mod/file2alias.c are the
> only users of that header that use more than a few device-id structs. So
> their number of lines actually grows when unfolding the needed includes
> into them. Still it is a reduction in build dependencies.
>
> I suggest to take this via kbuild during the merge window. Would be great to
> cook in next for a while before.
>
> Best regards
> Uwe
>
> 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
>
> arch/loongarch/kvm/main.c | 2 +-
> include/linux/cpufeature.h | 12 ++++++-
> include/linux/mod_devicetable.h | 13 -------
> scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
> scripts/mod/file2alias.c | 56 +++++++++++++++++++++++++++++-
> 5 files changed, 123 insertions(+), 17 deletions(-)
My apologies for taking some time to get to this. I was planning on
building it using my personal test matrix on a local machine at home
while travelling for Plumbers to avoid tying up my main workstation but
my home's internet connection has been down for two weeks with very
little hope of getting it online before I am back...
Sashiko has a few comments that seem relevant (most of them are the same
issue):
https://sashiko.dev/#/patchset/cover.1789988540.git.u.kleine-koenig@baylibre.com
I have applied it on top of next-20261005 to see what conflicts are
looking like. I see a merge conflict with this series from
d59717cfbe1e ("firmware: arm_scmi: Add SCMI device table alias support")
in the soc tree, which is fairly trivial. There is a semantic conflict
that results in a build error from
fe7f2a805443 ("firmware: smccc: Add an Arm SMCCC bus")
in the arm64 tree, which is also trivial but subtle.
scripts/mod/devicetable-offsets.c:317:2: error: invalid application of 'sizeof' to an incomplete type 'struct arm_smccc_device_id'
317 | DEVID(arm_smccc_device_id);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/mod/devicetable-offsets.c:62:43: note: expanded from macro 'DEVID'
62 | #define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
include/linux/kbuild.h:6:62: note: expanded from macro 'DEFINE'
6 | asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
| ^~~
scripts/mod/devicetable-offsets.c:317:8: note: forward declaration of 'struct arm_smccc_device_id'
317 | DEVID(arm_smccc_device_id);
| ^
scripts/mod/devicetable-offsets.c:318:2: error: offsetof of incomplete type 'struct arm_smccc_device_id'
318 | DEVID_FIELD(arm_smccc_device_id, func_id);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/mod/devicetable-offsets.c:64:32: note: expanded from macro 'DEVID_FIELD'
64 | DEFINE(OFF_##devid##_##field, offsetof(struct devid, field))
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
| ^
include/linux/kbuild.h:6:62: note: expanded from macro 'DEFINE'
6 | asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
| ^~~
scripts/mod/devicetable-offsets.c:317:8: note: forward declaration of 'struct arm_smccc_device_id'
317 | DEVID(arm_smccc_device_id);
| ^
2 errors generated.
If you would like this in 7.4-rc1, I am not opposed to sticking your v2
into -next now but I plan to finalize the Kbuild tree for 7.4 around
October 15, so we'd only get a week or so of build coverage. If that
feels like too little, we should defer this until after 7.4-rc1 is out.
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues
2026-10-05 15:23 ` Nathan Chancellor
@ 2026-10-06 8:54 ` Nathan Chancellor
0 siblings, 0 replies; 7+ messages in thread
From: Nathan Chancellor @ 2026-10-06 8:54 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Tianrui Zhao, Bibo Mao, Huacai Chen, Nicolas Schier,
Geert Uytterhoeven, Takashi Sakamoto, Raag Jadav,
Martin K. Petersen, Heiner Kallweit, Dave Hansen, Ingo Molnar,
Josh Poimboeuf, Jorge Sanjuan Garcia,
Jose Javier Rodriguez Barbarin, Ilpo Järvinen,
Alexey Gladkov, Hasan Basbunar, Hugh Dickins, Armin Wolf,
WANG Xuerui, kvm, loongarch, linux-kernel, linux-kbuild,
Sudeep Holla
On Mon, Oct 05, 2026 at 05:23:16PM +0200, Nathan Chancellor wrote:
> > this is a next step in the deprecation of <linux/mod_devicetable.h>.
> > scripts/mod/devicetable-offsets.c and scripts/mod/file2alias.c are the
> > only users of that header that use more than a few device-id structs. So
> > their number of lines actually grows when unfolding the needed includes
> > into them. Still it is a reduction in build dependencies.
> >
> > I suggest to take this via kbuild during the merge window. Would be great to
> > cook in next for a while before.
> >
> > Best regards
> > Uwe
> >
> > 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
> >
> > arch/loongarch/kvm/main.c | 2 +-
> > include/linux/cpufeature.h | 12 ++++++-
> > include/linux/mod_devicetable.h | 13 -------
> > scripts/mod/devicetable-offsets.c | 57 ++++++++++++++++++++++++++++++-
> > scripts/mod/file2alias.c | 56 +++++++++++++++++++++++++++++-
> > 5 files changed, 123 insertions(+), 17 deletions(-)
>
> My apologies for taking some time to get to this. I was planning on
> building it using my personal test matrix on a local machine at home
> while travelling for Plumbers to avoid tying up my main workstation but
> my home's internet connection has been down for two weeks with very
> little hope of getting it online before I am back...
>
> Sashiko has a few comments that seem relevant (most of them are the same
> issue):
>
> https://sashiko.dev/#/patchset/cover.1789988540.git.u.kleine-koenig@baylibre.com
>
> I have applied it on top of next-20261005 to see what conflicts are
> looking like. I see a merge conflict with this series from
>
> d59717cfbe1e ("firmware: arm_scmi: Add SCMI device table alias support")
>
> in the soc tree, which is fairly trivial. There is a semantic conflict
> that results in a build error from
>
> fe7f2a805443 ("firmware: smccc: Add an Arm SMCCC bus")
>
> in the arm64 tree, which is also trivial but subtle.
>
> scripts/mod/devicetable-offsets.c:317:2: error: invalid application of 'sizeof' to an incomplete type 'struct arm_smccc_device_id'
> 317 | DEVID(arm_smccc_device_id);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~
> scripts/mod/devicetable-offsets.c:62:43: note: expanded from macro 'DEVID'
> 62 | #define DEVID(devid) DEFINE(SIZE_##devid, sizeof(struct devid))
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
> include/linux/kbuild.h:6:62: note: expanded from macro 'DEFINE'
> 6 | asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
> | ^~~
> scripts/mod/devicetable-offsets.c:317:8: note: forward declaration of 'struct arm_smccc_device_id'
> 317 | DEVID(arm_smccc_device_id);
> | ^
> scripts/mod/devicetable-offsets.c:318:2: error: offsetof of incomplete type 'struct arm_smccc_device_id'
> 318 | DEVID_FIELD(arm_smccc_device_id, func_id);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> scripts/mod/devicetable-offsets.c:64:32: note: expanded from macro 'DEVID_FIELD'
> 64 | DEFINE(OFF_##devid##_##field, offsetof(struct devid, field))
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/stddef.h:16:32: note: expanded from macro 'offsetof'
> 16 | #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
> | ^
> include/linux/kbuild.h:6:62: note: expanded from macro 'DEFINE'
> 6 | asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
> | ^~~
> scripts/mod/devicetable-offsets.c:317:8: note: forward declaration of 'struct arm_smccc_device_id'
> 317 | DEVID(arm_smccc_device_id);
> | ^
> 2 errors generated.
>
> If you would like this in 7.4-rc1, I am not opposed to sticking your v2
> into -next now but I plan to finalize the Kbuild tree for 7.4 around
> October 15, so we'd only get a week or so of build coverage. If that
> feels like too little, we should defer this until after 7.4-rc1 is out.
Two more issues came up in my testing.
ARCH=loongarch defconfig:
In file included from include/linux/mmzone.h:20,
from include/linux/gfp.h:7,
from include/linux/xarray.h:16,
from include/linux/list_lru.h:14,
from include/linux/fs/super_types.h:7,
from include/linux/fs/super.h:5,
from include/linux/fs.h:5,
from arch/loongarch/include/asm/elf.h:9,
from arch/loongarch/include/asm/cpufeature.h:13,
from include/linux/cpufeature.h:23,
from scripts/mod/devicetable-offsets.c:3:
include/linux/page-flags-layout.h:6:10: fatal error: generated/bounds.h: No such file or directory
6 | #include <generated/bounds.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.build:185: scripts/mod/devicetable-offsets.s] Error 1
ARCH=s390 defconfig:
drivers/s390/crypto/pkey_ep11.c:23:28: error: array type has incomplete element type 'struct ap_device_id'
23 | static struct ap_device_id pkey_ep11_card_ids[] = {
| ^~~~~~~~~~~~~~~~~~
make[7]: *** [scripts/Makefile.build:290: drivers/s390/crypto/pkey_ep11.o] Error 1
drivers/s390/crypto/pkey_cca.c:22:28: error: array type has incomplete element type 'struct ap_device_id'
22 | static struct ap_device_id pkey_cca_card_ids[] = {
| ^~~~~~~~~~~~~~~~~
make[7]: *** [scripts/Makefile.build:290: drivers/s390/crypto/pkey_cca.o] Error 1
--
Cheers,
Nathan
^ permalink raw reply [flat|nested] 7+ messages in thread