From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Haixu Cui <quic_haixcui@quicinc.com>
Cc: harald.mommer@oss.qualcomm.com, quic_msavaliy@quicinc.com,
broonie@kernel.org, virtio-dev@lists.linux.dev,
viresh.kumar@linaro.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, hdanton@sina.com,
qiang4.zhang@linux.intel.com, alex.bennee@linaro.org,
quic_ztu@quicinc.com, virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v9 3/3] SPI: Add virtio SPI driver
Date: Thu, 11 Sep 2025 10:48:47 +0300 [thread overview]
Message-ID: <aMJ-32RkzRuUQ_CP@smile.fi.intel.com> (raw)
In-Reply-To: <b9e9b4e5-7004-471b-a067-b6bacda2a0ca@quicinc.com>
On Wed, Sep 10, 2025 at 11:51:03AM +0800, Haixu Cui wrote:
> On 9/3/2025 6:27 PM, Andy Shevchenko wrote:
> > On Wed, Sep 03, 2025 at 05:04:46PM +0800, Haixu Cui wrote:
> > > On 9/1/2025 8:07 PM, Andy Shevchenko wrote:
> > > > On Thu, Aug 28, 2025 at 05:34:51PM +0800, Haixu Cui wrote:
> > > > > This is the virtio SPI Linux kernel driver.
...
> > > > > +#include <linux/completion.h>
> > > > > +#include <linux/interrupt.h>
> > > > > +#include <linux/io.h>
> > > > > +#include <linux/module.h>
> > > > > +#include <linux/spi/spi.h>
> > > > > +#include <linux/stddef.h>
> > > >
> > > > A lot of headers are still missing. See below.
> > >
> > > This driver compiles successfully, and I believe all required definitions
> > > are resolved through indirect inclusion. For example, since I included
> > > virtio.h, there is no need to explicitly include device.h, scatterlist.h or
> > > types.h.
> > >
> > > I avoided redundant #includes to keep the code clean and minimal.
> > >
> > > If there are any essential headers I’ve overlooked, please feel free to
> > > highlight them—I’ll gladly include them in the next revision.
> >
> > The rationale is described on https://include-what-you-use.org/.
>
> Thanks for your feedback and for pointing me to the iwyu guidelines.
>
> I've experimented with the iwyu tool, and while for spi-virtio.c I noticed
> that it recommends header that is not directly to the code - such as
> vdso/cache.h - and occasionally suggests re-include header like
> linux/spi/spi.h that is already present.
> iwyu is a power tool expecially in application-level development for C++
> projects where header dependencies are more straightforward. However it
> seems iwyu may not yet be fully suited for analyzing Linux kernel due to its
> complexity and conditional inclusions.
I was not talking about the tool, yes, this tool is not ready for Linux kernel.
Jonathan Cameron played with it to make it useful for the Linux kernel project,
but it seems the work is stalled.
> Additionally, I’ve verified that the driver compiles successfully with both
> gcc and clang, which indicates that all required definitions are either
> directly or indirectly resolved.
The IWYU principle is against the includes that indirectly resolve types and
APIs. The problem that some headers are included in others and that relation
is guaranteed, but we do not have an official list of the guarantees, so this
is a tribal knowledge.
Basically the developer should know a bit more about the Linux kernel header
organisation to fulfill IWYU. And this is currently problematic.
> I appreciate your guidance and will continue to refine the patch with
> clarity and maintainability in mind.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2025-09-11 7:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 9:34 [PATCH v9 0/3] Virtio SPI Linux driver Haixu Cui
2025-08-28 9:34 ` [PATCH v9 1/3] virtio: Add ID for virtio SPI Haixu Cui
2025-09-10 9:39 ` Alex Bennée
2025-08-28 9:34 ` [PATCH v9 2/3] virtio-spi: Add virtio-spi.h Haixu Cui
2025-09-10 9:43 ` Alex Bennée
2025-08-28 9:34 ` [PATCH v9 3/3] SPI: Add virtio SPI driver Haixu Cui
2025-09-01 12:07 ` Andy Shevchenko
2025-09-02 15:54 ` Harald Mommer
2025-09-02 16:28 ` Mark Brown
2025-09-03 9:04 ` Haixu Cui
2025-09-03 10:27 ` Andy Shevchenko
2025-09-10 3:51 ` Haixu Cui
2025-09-11 7:48 ` Andy Shevchenko [this message]
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=aMJ-32RkzRuUQ_CP@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=alex.bennee@linaro.org \
--cc=broonie@kernel.org \
--cc=harald.mommer@oss.qualcomm.com \
--cc=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=qiang4.zhang@linux.intel.com \
--cc=quic_haixcui@quicinc.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_ztu@quicinc.com \
--cc=viresh.kumar@linaro.org \
--cc=virtio-dev@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.