Re: [PATCH 04/14] iio: temperature: ltc2983: make headers conform to IWYU
From: Jonathan Cameron
Date: Sun Aug 23 2026 - 13:52:34 EST
On Sat, 22 Aug 2026 10:02:31 +0200
Joshua Crofts <joshua.crofts1@xxxxxxxxx> wrote:
> Remove the catch-all kernel.h header and add the missing headers to
> enforce IWYU.
>
> Signed-off-by: Joshua Crofts <joshua.crofts1@xxxxxxxxx>
> ---
> Header changes explained:
> Added:
> - <asm/div64.h>: for div64 functions
> - <linux/array_size.h>: for ARRAY_SIZE()
> - <linux/bits.h>: for GENMASK() and BIT() macros
> - <linux/mutex.h>: for struct mutex and mutex_lock/unlock
> - <linux/types.h>: for fixed-width integer types (u8, u16, etc.)
> Removed:
> - <linux/errno.h>: not directly used in this driver
> - <linux/kernel.h>: catch-all header no longer needed
> ---
> drivers/iio/temperature/ltc2983.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
> index fe9eec3058d4..0b1b442bb133 100644
> --- a/drivers/iio/temperature/ltc2983.c
> +++ b/drivers/iio/temperature/ltc2983.c
> @@ -5,22 +5,26 @@
> *
> * Copyright 2019 Analog Devices Inc.
> */
> +
> +#include <linux/array_size.h>
> #include <linux/bitfield.h>
> +#include <linux/bits.h>
> #include <linux/completion.h>
> #include <linux/device.h>
> #include <linux/err.h>
> -#include <linux/errno.h>
> -#include <linux/kernel.h>
> #include <linux/interrupt.h>
> #include <linux/list.h>
> #include <linux/module.h>
> +#include <linux/mutex.h>
> #include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/regulator/consumer.h>
> #include <linux/spi/spi.h>
> +#include <linux/types.h>
> #include <linux/unaligned.h>
>
> #include <asm/byteorder.h>
> +#include <asm/div64.h>
I think we normally use linux/math64.h for that one.
>
> #include <linux/iio/iio.h>
>
>