Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Joshua Crofts <joshua.crofts1@gmail.com>,
	jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: mapping file for include-what-you-use tool
Date: Tue, 12 May 2026 18:51:44 +0300	[thread overview]
Message-ID: <agNMkMgSIgQJZLex@ashevche-desk.local> (raw)
In-Reply-To: <4742ea18-f3df-46dd-aad4-18d1e5f03f7f@baylibre.com>

On Tue, May 12, 2026 at 10:36:00AM -0500, David Lechner wrote:
> On 5/12/26 2:35 AM, Joshua Crofts wrote:
> > As promised, I'm sending my IWYU mapping file, based on Jonathan's
> > version with a few additional tweaks by me.
> > 
> > Other than adding support for more assembly file business, I've also
> > experimented with individual symbol definition (see BIT() and GENMASK()
> > in the following file) - this is to prevent issues such as the tool
> > wanting you to include <linux/bits.h> when you already have
> > <linux/bitops.h> in the source file (I agree, doing this symbol by
> > symbol is tedious, but BIT() and GENMASK() are symbols that especially
> > do this, and they're included in most, if not all drivers).
> 
> TBH, I would favor rules that are easy for machines over rules that
> follow existing human conventions. Is there really anything terribly
> wrong with including both bits.h and bitops.h other than "convention"?

But why? When one needs bitops APIs it includes BIT() and GENMASK() for bonus.
Same with (and especially) bitmap.h. The latter is rather a heavy header.
I do not see any point of having all three and even two out of the three
bits.h, bitops.h, bitmap.h. Also this is a type of unification that helps
scripting any further header reshuffling / cleanups / ... If we ever do
something with bits.h, let's do it on the files that really use only it.

So, all that being said, I prefer to follow guarantees and change them
if required once for all stakeholders, the mixing makes it harder to achieve.
Bonus is the compilation time (maybe negligible, though).


> > Feel free to improve this file and pass it on. I wouldn't really fully
> > rely on IWYU as even with the mapping file the results can be weird,
> > but it definitely serves as a good starting point when doing driver
> > cleanup.
> > 
> > I'm making this patch an RFC - this is not intended for merging.
> > 
> Sharing it is nice. Automating it would be amazing.
> 
> Not sure what the best way to do this would be though. I've considered
> the idea of having an IIO linting service that could run iwyu and some
> other checkers that catch common issues, like spaces in { }, where and
> where not to use trailing commas, etc.
> 
> At first, it could just post the results on a public page (like sashisko).
> And if it ends up working well, it could eventually automatically reply
> to patch emails.
> 
> The hardest part would be finding someone willing to host and maintain it.

Hmm... Where the media subsystem does that? They have their own validation.
Also VFS and maybe others (Ah, yes, net and bpf are also using their bots).

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-05-12 15:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12  7:35 [PATCH] iio: mapping file for include-what-you-use tool Joshua Crofts
2026-05-12  7:36 ` Joshua Crofts
2026-05-12  8:00   ` Andy Shevchenko
2026-05-12  8:00 ` Andy Shevchenko
2026-05-12  8:04   ` Joshua Crofts
2026-05-12  8:07     ` Andy Shevchenko
2026-05-12  8:10       ` Joshua Crofts
2026-05-12 15:36 ` David Lechner
2026-05-12 15:51   ` Andy Shevchenko [this message]
2026-05-12 15:57     ` David Lechner
2026-05-13  8:24       ` Joshua Crofts
2026-05-12 17:07   ` Jonathan Cameron

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=agNMkMgSIgQJZLex@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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