[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZfSTrbAr3d2xORr@smile.fi.intel.com>
Date: Fri, 19 Nov 2021 18:35:26 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "Alejandro Colomar (man-pages)" <alx.manpages@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, LKML <linux-kernel@...r.kernel.org>,
Ajit Khaparde <ajit.khaparde@...adcom.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Borislav Petkov <bp@...e.de>,
Corey Minyard <cminyard@...sta.com>, Chris Mason <clm@...com>,
Christian Brauner <christian.brauner@...ntu.com>,
David Sterba <dsterba@...e.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Jason Wang <jasowang@...hat.com>,
Jitendra Bhivare <jitendra.bhivare@...adcom.com>,
John Hubbard <jhubbard@...dia.com>,
"John S . Gruber" <JohnSGruber@...il.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Josef Bacik <josef@...icpanda.com>,
Kees Cook <keescook@...omium.org>,
Ketan Mukadam <ketan.mukadam@...adcom.com>,
Len Brown <lenb@...nel.org>,
"Michael S. Tsirkin" <mst@...hat.com>,
Miguel Ojeda <ojeda@...nel.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Russell King <linux@...linux.org.uk>,
Somnath Kotur <somnath.kotur@...adcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>,
Subbu Seetharaman <subbu.seetharaman@...adcom.com>,
Intel Graphics <intel-gfx@...ts.freedesktop.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-btrfs <linux-btrfs@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
"open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE"
<virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly
simplify code
On Fri, Nov 19, 2021 at 05:22:48PM +0100, Alejandro Colomar (man-pages) wrote:
>
>
> On 11/19/21 17:18, Arnd Bergmann wrote:
> > On Fri, Nov 19, 2021 at 5:10 PM Andy Shevchenko
> > <andriy.shevchenko@...ux.intel.com> wrote:
> >> On Fri, Nov 19, 2021 at 04:57:46PM +0100, Arnd Bergmann wrote:
> >
> >>> The main problem with this approach is that as soon as you start
> >>> actually reducing the unneeded indirect includes, you end up with
> >>> countless .c files that no longer build because they are missing a
> >>> direct include for something that was always included somewhere
> >>> deep underneath, so I needed a second set of scripts to add
> >>> direct includes to every .c file.
> >>
> >> Can't it be done with cocci support?
> >
> > There are many ways of doing it, but they all tend to suffer from the
> > problem of identifying which headers are actually needed based on
> > the contents of a file, and also figuring out where to put the extra
> > #include if there are complex #ifdefs.
> >
> > For reference, see below for the naive pattern matching I tried.
> > This is obviously incomplete and partially wrong.
>
> FYI, if you may not know the tool,
> theres include-what-you-use(1) (a.k.a. iwyu(1))[1],
> although it is still not mature,
> and I'm helping improve it a bit.
Yes, I know the tool, but it produces insanity. Jonathan (maintainer
of IIO subsystem) actually found it useful after manual work applied.
Perhaps you can chat with him about usage of it in the Linux kernel.
> If I understood better the kernel Makefiles,
> I'd try it.
>
> You can try it yourselves.
> I still can't use it for my own code,
> since it has a lot of false positives.
> [1]: <https://include-what-you-use.org/>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists