From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
Cc: Corey Minyard <cminyard@mvista.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Chris Mason <clm@fb.com>,
Christian Brauner <christian.brauner@ubuntu.com>,
Ketan Mukadam <ketan.mukadam@broadcom.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Subbu Seetharaman <subbu.seetharaman@broadcom.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Russell King <linux@armlinux.org.uk>,
Mike Rapoport <rppt@linux.ibm.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Miguel Ojeda <ojeda@kernel.org>, Borislav Petkov <bp@suse.de>,
"open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE"
<virtualization@lists.linux-foundation.org>,
Len Brown <lenb@kernel.org>, Kees Cook <keescook@chromium.org>,
Arnd Bergmann <arnd@arndb.de>, John Hubbard <jhubbard@nvidia.com>,
Intel Graphics <intel-gfx@lists.freedesktop.org>,
Josef Bacik <josef@toxicpanda.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Jitendra Bhivare <jitendra.bhivare@broadcom.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
David Sterba <dsterba@suse.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
Networking <netdev@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
LKML <linux-kernel@vger.kernel.org>,
"John S . Gruber" <JohnSGruber@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code
Date: Fri, 19 Nov 2021 18:35:26 +0200 [thread overview]
Message-ID: <YZfSTrbAr3d2xORr@smile.fi.intel.com> (raw)
In-Reply-To: <2d790206-124b-f850-895f-a57a74c55f79@gmail.com>
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@linux.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
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2021-11-19 16:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211119113644.1600-1-alx.manpages@gmail.com>
2021-11-19 12:47 ` [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code Jani Nikula
[not found] ` <a9522c0e-0762-c7cd-edb1-0376c435c4d9@gmail.com>
2021-11-19 13:48 ` Jani Nikula
2021-11-19 14:54 ` Andy Shevchenko
2021-11-19 14:47 ` Arnd Bergmann
[not found] ` <434296d3-8fe1-f1d2-ee9d-ea25d6c4e43e@gmail.com>
2021-11-19 15:34 ` Andy Shevchenko
2021-11-19 15:57 ` Arnd Bergmann
2021-11-19 16:10 ` Andy Shevchenko
2021-11-19 16:18 ` Arnd Bergmann
[not found] ` <2d790206-124b-f850-895f-a57a74c55f79@gmail.com>
2021-11-19 16:27 ` Arnd Bergmann
2021-11-19 16:35 ` Andy Shevchenko [this message]
[not found] ` <f751fb48-d19c-88af-452e-680994a586b4@gmail.com>
2021-11-19 16:25 ` Arnd Bergmann
2021-11-19 16:37 ` Andy Shevchenko
[not found] ` <20211119113644.1600-3-alx.manpages@gmail.com>
2021-11-23 18:07 ` [PATCH 02/17] Use memberof(T, m) instead of explicit NULL dereference Rafael J. Wysocki
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=YZfSTrbAr3d2xORr@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=JohnSGruber@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=ajit.khaparde@broadcom.com \
--cc=akpm@linux-foundation.org \
--cc=alx.manpages@gmail.com \
--cc=arnd@arndb.de \
--cc=bjorn.andersson@linaro.org \
--cc=bp@suse.de \
--cc=christian.brauner@ubuntu.com \
--cc=clm@fb.com \
--cc=cminyard@mvista.com \
--cc=dsterba@suse.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jhubbard@nvidia.com \
--cc=jitendra.bhivare@broadcom.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=josef@toxicpanda.com \
--cc=keescook@chromium.org \
--cc=ketan.mukadam@broadcom.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linux@rasmusvillemoes.dk \
--cc=mst@redhat.com \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rafael@kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=rppt@linux.ibm.com \
--cc=somnath.kotur@broadcom.com \
--cc=sriharsha.basavapatna@broadcom.com \
--cc=subbu.seetharaman@broadcom.com \
--cc=virtualization@lists.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;
as well as URLs for NNTP newsgroup(s).