Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v3] iio: accel: stk8ba50: Update includes to match IWYU
@ 2026-06-17  1:38 Miao Li
  2026-06-19  7:27 ` Joshua Crofts
  0 siblings, 1 reply; 3+ messages in thread
From: Miao Li @ 2026-06-17  1:38 UTC (permalink / raw)
  To: jic23
  Cc: andy, dlechner, nuno.sa, dixitparmar19, bigeasy, linux-iio,
	linux-kernel, limiao870622, Miao Li, Andy Shevchenko

From: Miao Li <limiao@kylinos.cn>

Update the list of included headers in stk8ba50.c using
Include-What-You-Use (IWYU) tool, mainly to remove kernel.h
and add missing headers such as array_size.h, bits.h,
dev_printk.h, etc.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Miao Li <limiao@kylinos.cn>
---

Changes in v3:
- Put the changelog after cutter line, no functional changes.
- Link to v2:
  https://lore.kernel.org/all/20260615092116.83850-1-limiao870622@163.com/

Changes in v2:
- Drop linux/iio/types.h as it is already included by linux/iio/iio.h
- Link to v1:
  https://lore.kernel.org/all/20260603015033.187735-1-limiao870622@163.com/

 drivers/iio/accel/stk8ba50.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c
index a9ff2a273fe1..6a60c0fcebe9 100644
--- a/drivers/iio/accel/stk8ba50.c
+++ b/drivers/iio/accel/stk8ba50.c
@@ -7,12 +7,19 @@
  * STK8BA50 7-bit I2C address: 0x18.
  */
 
+#include <linux/array_size.h>
+#include <linux/bits.h>
+#include <linux/dev_printk.h>
+#include <linux/errno.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
-#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/mod_devicetable.h>
+#include <linux/mutex.h>
+#include <linux/pm.h>
+#include <linux/sysfs.h>
 #include <linux/types.h>
+
 #include <linux/iio/buffer.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: accel: stk8ba50: Update includes to match IWYU
  2026-06-17  1:38 [PATCH v3] iio: accel: stk8ba50: Update includes to match IWYU Miao Li
@ 2026-06-19  7:27 ` Joshua Crofts
  2026-06-19  9:14   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Crofts @ 2026-06-19  7:27 UTC (permalink / raw)
  To: Miao Li
  Cc: jic23, andy, dlechner, nuno.sa, dixitparmar19, bigeasy, linux-iio,
	linux-kernel, Miao Li, Andy Shevchenko

On Wed, 17 Jun 2026 09:38:34 +0800
Miao Li <limiao870622@163.com> wrote:

> +#include <linux/array_size.h>
> +#include <linux/bits.h>
> +#include <linux/dev_printk.h>
> +#include <linux/errno.h>
>  #include <linux/i2c.h>
>  #include <linux/interrupt.h>
> -#include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/mutex.h>
> +#include <linux/pm.h>
> +#include <linux/sysfs.h>
>  #include <linux/types.h>
> +
>  #include <linux/iio/buffer.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>

The driver uses sign_extend32(), which is included in <linux/bitops.h>.
Consider removing bits.h and adding bitops.h instead.

-- 
Kind regards

CJD

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] iio: accel: stk8ba50: Update includes to match IWYU
  2026-06-19  7:27 ` Joshua Crofts
@ 2026-06-19  9:14   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-06-19  9:14 UTC (permalink / raw)
  To: Joshua Crofts
  Cc: Miao Li, jic23, andy, dlechner, nuno.sa, dixitparmar19, bigeasy,
	linux-iio, linux-kernel, Miao Li

On Fri, Jun 19, 2026 at 09:27:31AM +0200, Joshua Crofts wrote:
> On Wed, 17 Jun 2026 09:38:34 +0800
> Miao Li <limiao870622@163.com> wrote:

...

> The driver uses sign_extend32(), which is included in <linux/bitops.h>.
> Consider removing bits.h and adding bitops.h instead.

Good catch!

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-19  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-17  1:38 [PATCH v3] iio: accel: stk8ba50: Update includes to match IWYU Miao Li
2026-06-19  7:27 ` Joshua Crofts
2026-06-19  9:14   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox