Re: [PATCH v1 0/3] <linux/mod_devicetable.h> deprecation continues

From: Nathan Chancellor

Date: Mon Oct 05 2026 - 11:27:30 EST


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@xxxxxxxxxxxx

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