* [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)
0 siblings, 0 replies; 2+ 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 related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h>
@ 2026-10-24 20:47 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-10-24 20:47 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "linux-review patch is more than 7 days old, verify it wasn't already superseded"
::::::
BCC: lkp@intel.com
CC: llvm@lists.linux.dev
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <bc9fbf5784f6788e10c749a05d56c42bdb68f3d9.1792144769.git.u.kleine-koenig@baylibre.com>
References: <bc9fbf5784f6788e10c749a05d56c42bdb68f3d9.1792144769.git.u.kleine-koenig@baylibre.com>
TO: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
TO: Nathan Chancellor <nathan@kernel.org>
CC: Tianrui Zhao <zhaotianrui@loongson.cn>
CC: Bibo Mao <maobibo@loongson.cn>
CC: Huacai Chen <chenhuacai@kernel.org>
CC: WANG Xuerui <kernel@xen0n.name>
CC: Nicolas Schier <nsc@kernel.org>
CC: Armin Wolf <W_Armin@gmx.de>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Takashi Sakamoto <o-takashi@sakamocchi.jp>
CC: Heiner Kallweit <hkallweit1@gmail.com>
CC: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Raag Jadav <raag.jadav@intel.com>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
CC: Andy Shevchenko <andriy.shevchenko@intel.com>
CC: Ingo Molnar <mingo@kernel.org>
CC: Josh Poimboeuf <jpoimboe@kernel.org>
CC: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
CC: Hasan Basbunar <basbunarhasan@gmail.com>
CC: kvm@vger.kernel.org
CC: loongarch@lists.linux.dev
CC: linux-kernel@vger.kernel.org
CC: linux-kbuild@vger.kernel.org
Hi Uwe,
kernel test robot noticed the following build errors:
[auto build test ERROR on 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig-The-Capable-Hub/Move-struct-cpu_feature-to-linux-cpufeature-h/20261016-120912
base: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
patch link: https://lore.kernel.org/r/bc9fbf5784f6788e10c749a05d56c42bdb68f3d9.1792144769.git.u.kleine-koenig%40baylibre.com
patch subject: [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h>
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: s390-defconfig (https://download.01.org/0day-ci/archive/20261025/202610250424.sRkI58av-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261025/202610250424.sRkI58av-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202610250424.sRkI58av-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/s390/crypto/pkey_cca.c:22:45: error: array has incomplete element type 'struct ap_device_id'
22 | static struct ap_device_id pkey_cca_card_ids[] = {
| ^
drivers/s390/crypto/ap_bus.h:158:9: note: forward declaration of 'struct ap_device_id'
158 | struct ap_device_id *ids;
| ^
1 error generated.
--
>> drivers/s390/crypto/pkey_ep11.c:23:46: error: array has incomplete element type 'struct ap_device_id'
23 | static struct ap_device_id pkey_ep11_card_ids[] = {
| ^
drivers/s390/crypto/ap_bus.h:158:9: note: forward declaration of 'struct ap_device_id'
158 | struct ap_device_id *ids;
| ^
1 error generated.
vim +22 drivers/s390/crypto/pkey_cca.c
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 20
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 21 #if IS_MODULE(CONFIG_PKEY_CCA)
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 @22 static struct ap_device_id pkey_cca_card_ids[] = {
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 23 { .dev_type = AP_DEVICE_TYPE_CEX4 },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 24 { .dev_type = AP_DEVICE_TYPE_CEX5 },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 25 { .dev_type = AP_DEVICE_TYPE_CEX6 },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 26 { .dev_type = AP_DEVICE_TYPE_CEX7 },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 27 { .dev_type = AP_DEVICE_TYPE_CEX8 },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 28 { /* end of list */ },
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 29 };
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 30 MODULE_DEVICE_TABLE(ap, pkey_cca_card_ids);
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 31 #endif
8fcc231ce3bea1 Harald Freudenberger 2024-08-22 32
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-24 20:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 20:47 [PATCH v2 1/3] Move struct cpu_feature to <linux/cpufeature.h> kernel test robot
-- strict thread matches above, loose matches on Subject: below --
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)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.