From: Sasha Levin <sashal@kernel.org>
To: Nicolas Schier <nsc@kernel.org>, Nathan Chancellor <nathan@kernel.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Harald Freudenberger" <freude@linux.ibm.com>,
"Holger Dengler" <dengler@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>,
"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
linux-kbuild@vger.kernel.org, linux-s390@vger.kernel.org,
loongarch@lists.linux.dev, linux-mips@vger.kernel.org,
linux-kernel@vger.kernel.org,
"kernelci.org bot" <bot@kernelci.org>
Subject: [PATCH 2/2] devicetable-offsets: Get struct cpu_feature from a device-id header
Date: Mon, 9 Nov 2026 09:14:41 -0500 [thread overview]
Message-ID: <f610c07f39df15f3e7ebdc63bfcd759ca7a687a8.1794233316.git.sashal@kernel.org> (raw)
In-Reply-To: <66e4ee9c7f9b4bc48fcee92a94b6bb6d92fe1ad2.1794233316.git.sashal@kernel.org>
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
prev parent reply other threads:[~2026-11-09 14:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f610c07f39df15f3e7ebdc63bfcd759ca7a687a8.1794233316.git.sashal@kernel.org \
--to=sashal@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=bot@kernelci.org \
--cc=chenhuacai@kernel.org \
--cc=dengler@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kernel@xen0n.name \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®