Re: [PATCH] iio: mapping file for include-what-you-use tool

From: Andy Shevchenko

Date: Tue May 12 2026 - 04:05:25 EST


On Tue, May 12, 2026 at 07:35:05AM +0000, Joshua Crofts wrote:
> As promised, I'm sending my IWYU mapping file, based on Jonathan's
> version with a few additional tweaks by me.

Please, also add a link to Jonathan's version.

> 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).
>
> 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.

...


> + { "include": ["\"vdso/bits.h\"", "private", "<linux/bits.h>", "public"] },
> + { "include": ["\"vdso/ktime.h\"", "private", "<linux/ktime.h>", "public"] },
> + { "include": ["\"vdso/limits.h\"", "private", "<linux/limits.h>", "public"] },
> + { "include": ["\"vdso/time64.h\"", "private", "<linux/time64.h>", "public"] },

> +

Trailing whitespaces.

> + { "include": ["\"asm-generic/div64.h\"", "private", "<linux/math64.h>", "public"] },
> + { "include": ["\"asm-generic/errno.h\"", "private", "<linux/errno.h>", "public"] },
> + { "include": ["\"asm-generic/errno-base.h\"", "private", "<linux/errno.h>", "public"] },
> + { "include": ["\"asm-generic/int-ll64.h\"", "private", "<linux/types.h>", "public"] },

--
With Best Regards,
Andy Shevchenko