The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 linux-kernel@vger.kernel.org, Rob Herring <robh@kernel.org>,
	 Saravana Kannan <saravanak@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	 "Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Andi Shyti <andi.shyti@kernel.org>,
	 Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH] mod_devicetable.h: Split into per subsystem headers
Date: Tue, 23 Jun 2026 16:47:53 +0200	[thread overview]
Message-ID: <ajqZ5mQvd-TeXUhN@monoceros> (raw)
In-Reply-To: <CAHk-=wh4NSMLDNLC=01AEpHf1+Y7VYMvag1bhJNx=Qw2B-TK6g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2259 bytes --]

Hello Linus,

On Mon, Jun 22, 2026 at 03:06:43PM -0700, Linus Torvalds wrote:
> On Mon, 22 Jun 2026 at 14:07, Uwe Kleine-König (The Capable Hub)
> <u.kleine-koenig@baylibre.com> wrote:
> >
> > Maybe it's sensible to adapt the top-5 or so
> > headers from the above list in the same go, as these will trigger quite
> > some recompilation again!?
> 
> Oh, and on this side - I really think the "convert drivers / headers"
> should be driven by some automated script.
> 
> Literally something that does the equivalent of
> 
>    for i in include/linux/mod_device_id/*.h
>    do
> 
>      # The new include line
>      line=$(echo $i | sed 's:include/\(.*\)$:#include <\1>:')
> 
>      # get the struct name with grep/sed/whatever
>      struct_name=$(grep 'struct.*device_id.*{' $i | ...)
> 
>      # find any users of it, insert new include
>      git grep -l "struct $struct_name" -- '*.c' |
>         xargs sed -i "/mod_devicetable.h/a $line"
> 
>    done
> 
> and after that has script (and by "that script" I don't mean the
> above, but some fixed and fleshed-out version that does something
> similar) has added all the new includes after the existing
> "mod_devicetable.h" include, a final script just removes the
> mod_devicetable.h include lines entirely.

I think it's ok to not include <linux/mod_device_id/$something.h> if
<linux/$something.h> is included. With that my current expectation is
that there isn't much to do apart from identifying the files that rely
on <linux/$somethingelse.h> to pull in mod_devicetable.h providing
${something}_device_id.

I wrote a script---I don't feel that old, so I picked Python :-)---that
knows about these correlations and currently I have ~700 files left to
check.

So in the end I expect a handful of driver patches plus switching the
the most important (or maybe all) <linux/$something.h>s from
<linux/mod_devicetable.h> to <linux/mod_device_id/$something>.

I guess that is ok then, too?

> That obviously implies that you should also do that "struct
> cpu_feature" thing.

My plan for that is to keep it in <linux/mod_devicetable.h> for now and
then sort it out once linux/mod_devicetable.h has less impact on the
whole tree.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-06-23 14:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 21:07 [PATCH] mod_devicetable.h: Split into per subsystem headers Uwe Kleine-König (The Capable Hub)
2026-06-22 21:49 ` Linus Torvalds
2026-06-23  5:24   ` Greg Kroah-Hartman
2026-06-23  6:40   ` for next: ukleinek/linux.git:device-id-rework [Was: Re: [PATCH] mod_devicetable.h: Split into per subsystem headers] Uwe Kleine-König (The Capable Hub)
2026-06-23 11:12     ` Mark Brown
2026-06-22 22:06 ` [PATCH] mod_devicetable.h: Split into per subsystem headers Linus Torvalds
2026-06-23 14:47   ` Uwe Kleine-König (The Capable Hub) [this message]
2026-06-23 14:54     ` Linus Torvalds
2026-06-23 16:13       ` Uwe Kleine-König (The Capable Hub)

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=ajqZ5mQvd-TeXUhN@monoceros \
    --to=u.kleine-koenig@baylibre.com \
    --cc=andi.shyti@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=saravanak@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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