On Wed, Feb 12, 2025 at 09:52:37AM +0100, Uwe Kleine-König wrote: > On Tue, Feb 11, 2025 at 09:12:30PM +0200, Andy Shevchenko wrote: > > On Tue, Feb 11, 2025 at 07:45:30PM +0100, Uwe Kleine-König wrote: > > > I have no problem here. If the header becomes stale we will most > > > probably notice that eventually and remove it. > > > > Lol. Look at the header hell we have now. 98% code in the drivers/ just show > > that the developers either don't care or do not understand C (in terms of > > what headers are for and why it's important to follow IWYU principle). > > Yeah, there is a problem. The source is that we have a metric ton of > recursive includes (i.e. headers that include other headers that include > still more headers). Even if you care, its sometimes hard to know which > headers you actually need. One idea on my long-term list is to add a > machine-parsable info to header files about the list of symbols that the > given file is responsible for. With that in place we could create a > linter that tells you that this source file doesn't use any symbols from > <linux/of_irq.h> and it should #include <linux/of.h> directly instead to > make use of symbols defined there. > > > > Maybe the unused namespace even makes it easier to spot that issue. > > > > Do we have an existing tools for that? > > There is https://lore.kernel.org/all/20250123110951.370759-2-u.kleine-koenig@xxxxxxxxxxxx/ But it was rejected. So, the answer is "we currently do not have tools". -- With Best Regards, Andy Shevchenko