* [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)
` (3 more replies)
0 siblings, 4 replies; 7+ 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] 7+ 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)
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ 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] 7+ 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)
2026-11-08 19:20 ` [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Nicolas Schier
3 siblings, 0 replies; 7+ 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] 7+ 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)
2026-11-08 19:20 ` [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Nicolas Schier
3 siblings, 0 replies; 7+ 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] 7+ messages in thread
* Re: [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues
2026-10-16 10:09 [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Uwe Kleine-König (The Capable Hub)
` (2 preceding siblings ...)
2026-10-16 10:09 ` [PATCH v2 3/3] file2alias: " Uwe Kleine-König (The Capable Hub)
@ 2026-11-08 19:20 ` Nicolas Schier
2026-11-09 14:14 ` [PATCH 1/2] s390/pkey: Include <linux/device-id/ap.h> for struct ap_device_id Sasha Levin
3 siblings, 1 reply; 7+ messages in thread
From: Nicolas Schier @ 2026-11-08 19:20 UTC (permalink / raw)
To: Uwe Kleine-König (The Capable Hub)
Cc: Nathan Chancellor, 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.
Ok, then let's go; I am going to put this on kbuild-next-unstable and
kbuild-for-next.
Thanks.
--
Nicolas
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] s390/pkey: Include <linux/device-id/ap.h> for struct ap_device_id
2026-11-08 19:20 ` [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Nicolas Schier
@ 2026-11-09 14:14 ` Sasha Levin
2026-11-09 14:14 ` [PATCH 2/2] devicetable-offsets: Get struct cpu_feature from a device-id header Sasha Levin
0 siblings, 1 reply; 7+ messages in thread
From: Sasha Levin @ 2026-11-09 14:14 UTC (permalink / raw)
To: Nicolas Schier, Nathan Chancellor
Cc: Uwe Kleine-König, Harald Freudenberger, Holger Dengler,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Huacai Chen,
WANG Xuerui, Thomas Bogendoerfer, linux-kbuild, linux-s390,
loongarch, linux-mips, linux-kernel, kernelci.org bot
pkey_cca.c and pkey_ep11.c got struct ap_device_id from
<linux/mod_devicetable.h> by way of <linux/cpufeature.h>. Commit
cdfdbc11552b ("Move struct cpu_feature to <linux/cpufeature.h>") dropped
that include, so s390 defconfig no longer builds:
drivers/s390/crypto/pkey_cca.c:22:28: error: array type has incomplete element type 'struct ap_device_id'
drivers/s390/crypto/pkey_ep11.c:23:28: error: array type has incomplete element type 'struct ap_device_id'
Include the header that defines it, as the other AP drivers do.
Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://d.kernelci.org/i/maestro:7baaa311bc9c30a8ad43f42c24225ab2fead866a
Fixes: cdfdbc11552b ("Move struct cpu_feature to <linux/cpufeature.h>")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/s390/crypto/pkey_cca.c | 1 +
drivers/s390/crypto/pkey_ep11.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/s390/crypto/pkey_cca.c b/drivers/s390/crypto/pkey_cca.c
index e8dc2f77c137b..f95d61fd5b090 100644
--- a/drivers/s390/crypto/pkey_cca.c
+++ b/drivers/s390/crypto/pkey_cca.c
@@ -10,6 +10,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/cpufeature.h>
+#include <linux/device-id/ap.h>
#include "zcrypt_ccamisc.h"
#include "pkey_base.h"
diff --git a/drivers/s390/crypto/pkey_ep11.c b/drivers/s390/crypto/pkey_ep11.c
index f99c19323f3d7..f66fc97ad5adc 100644
--- a/drivers/s390/crypto/pkey_ep11.c
+++ b/drivers/s390/crypto/pkey_ep11.c
@@ -10,6 +10,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/cpufeature.h>
+#include <linux/device-id/ap.h>
#include "zcrypt_ccamisc.h"
#include "zcrypt_ep11misc.h"
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] devicetable-offsets: Get struct cpu_feature from a device-id header
2026-11-09 14:14 ` [PATCH 1/2] s390/pkey: Include <linux/device-id/ap.h> for struct ap_device_id Sasha Levin
@ 2026-11-09 14:14 ` Sasha Levin
0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2026-11-09 14:14 UTC (permalink / raw)
To: Nicolas Schier, Nathan Chancellor
Cc: Uwe Kleine-König, Harald Freudenberger, Holger Dengler,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev, Huacai Chen,
WANG Xuerui, Thomas Bogendoerfer, linux-kbuild, linux-s390,
loongarch, linux-mips, linux-kernel, kernelci.org bot
Since commit cdfdbc11552b ("Move struct cpu_feature to
<linux/cpufeature.h>"), devicetable-offsets.c includes
<linux/cpufeature.h>, which includes <asm/cpufeature.h> on architectures
that select GENERIC_CPU_AUTOPROBE. On loongarch and mips that header
pulls in <asm/elf.h>, and from there <linux/fs.h> and <linux/mmzone.h>,
which need <generated/bounds.h>. devicetable-offsets.c is built before
that header is generated, so even defconfig fails on both:
include/linux/page-flags-layout.h:6:10: fatal error: generated/bounds.h: No such file or directory
Move struct cpu_feature to <linux/device-id/cpu_feature.h>, next to the
other device id types, and include that from <linux/cpufeature.h>,
devicetable-offsets.c and file2alias.c.
Reported-by: kernelci.org bot <bot@kernelci.org>
Closes: https://d.kernelci.org/i/maestro:7473c68181d97f248d2541b3b91d105111c36f97
Closes: https://d.kernelci.org/i/maestro:9b122468fe2be859df134b78bb35a907e6f99ba7
Fixes: cdfdbc11552b ("Move struct cpu_feature to <linux/cpufeature.h>")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/cpufeature.h | 18 +-----------------
include/linux/device-id/cpu_feature.h | 18 ++++++++++++++++++
scripts/mod/devicetable-offsets.c | 2 +-
scripts/mod/file2alias.c | 2 +-
4 files changed, 21 insertions(+), 19 deletions(-)
create mode 100644 include/linux/device-id/cpu_feature.h
diff --git a/include/linux/cpufeature.h b/include/linux/cpufeature.h
index 7b22a536542d5..cd470987777f3 100644
--- a/include/linux/cpufeature.h
+++ b/include/linux/cpufeature.h
@@ -6,23 +6,7 @@
#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;
-};
+#include <linux/device-id/cpu_feature.h>
#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
diff --git a/include/linux/device-id/cpu_feature.h b/include/linux/device-id/cpu_feature.h
new file mode 100644
index 0000000000000..937fbe00dcd55
--- /dev/null
+++ b/include/linux/device-id/cpu_feature.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef LINUX_DEVICE_ID_CPU_FEATURE_H
+#define LINUX_DEVICE_ID_CPU_FEATURE_H
+
+#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;
+};
+
+#endif /* ifndef LINUX_DEVICE_ID_CPU_FEATURE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 875eafeb743de..2b5217edf6389 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#define COMPILE_OFFSETS
-#include <linux/cpufeature.h>
#include <linux/kbuild.h>
#include <linux/device-id/acpi.h>
@@ -12,6 +11,7 @@
#include <linux/device-id/ccw.h>
#include <linux/device-id/cdx.h>
#include <linux/device-id/coreboot.h>
+#include <linux/device-id/cpu_feature.h>
#include <linux/device-id/css.h>
#include <linux/device-id/dfl.h>
#include <linux/device-id/dmi.h>
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index f848b39145d97..08b45e096c164 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -121,7 +121,6 @@ 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/device-id/acpi.h"
#include "../../include/linux/device-id/amba.h"
#include "../../include/linux/device-id/ap.h"
@@ -131,6 +130,7 @@ typedef struct {
#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/cpu_feature.h"
#include "../../include/linux/device-id/css.h"
#include "../../include/linux/device-id/dfl.h"
#include "../../include/linux/device-id/dmi.h"
--
2.53.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-09 14:14 UTC | newest]
Thread overview: 7+ 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)
2026-11-08 19:20 ` [PATCH v2 0/3] <linux/mod_devicetable.h> deprecation continues Nicolas Schier
2026-11-09 14:14 ` [PATCH 1/2] s390/pkey: Include <linux/device-id/ap.h> for struct ap_device_id Sasha Levin
2026-11-09 14:14 ` [PATCH 2/2] devicetable-offsets: Get struct cpu_feature from a device-id header Sasha Levin
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®