Skip to contentSkip to conversation

IIO: Drop some unneeded export.h includes

PATCH In review Jonathan Cameron 5 participants 10 messages Jun 9, 2025 – Jun 11, 2025 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover IIO: Drop some unneeded export.h includes

From: Jonathan Cameron <[email protected]>

7d95680d64ac8 ("scripts/misc-check: check unnecessary #include <linux/export.h> when W=1") brings some new warnings about including export.h where it isn't used.

There are similar warnings where it is missing and should be present but more of those than I'm going to resolve this morning.

Jonathan

Jonathan Cameron (2):
iio: potentiometer: Drop unused export.h includes
iio: dummy: drop unused export.h include.

 drivers/iio/dummy/iio_simple_dummy_buffer.c | 1 -
 drivers/iio/potentiometer/ds1803.c          | 1 -
 drivers/iio/potentiometer/mcp4131.c         | 1 -
 3 files changed, 3 deletions(-)
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH 1/2 iio: potentiometer: Drop unused export.h includes

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

---
 drivers/iio/potentiometer/ds1803.c  | 1 -
 drivers/iio/potentiometer/mcp4131.c | 1 -
 2 files changed, 2 deletions(-)
drivers/iio/potentiometer/ds1803.c +0 -1
index 5761f69c538a..8a64d93f7e7b 100644
@@ -13,7 +13,6 @@
  */
 
 #include <linux/err.h>
-#include <linux/export.h>
 #include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
drivers/iio/potentiometer/mcp4131.c +0 -1
index 9082b559d029..ad082827aad5 100644
@@ -33,7 +33,6 @@
 
 #include <linux/cache.h>
 #include <linux/err.h>
-#include <linux/export.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/types.h>
 #include <linux/module.h>
Signature · 1 line
2.49.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] iio: potentiometer: Drop unused export.h includes

Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

With the given context this LGTM,

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author maintainer
#3 lore raw

Re: [PATCH 1/2] iio: potentiometer: Drop unused export.h includes

Quoted 11 lines · On Mon, 9 Jun 2025 12:28:40 +0300 Andy Shevchenko <[email protected]>…
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

With the given context this LGTM,

Picked this one up

author maintainer
#4 lore raw

PATCH 2/2 iio: dummy: Drop unused export.h include.

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

---
 drivers/iio/dummy/iio_simple_dummy_buffer.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/dummy/iio_simple_dummy_buffer.c +0 -1
index e35e0596cbfb..024f1135af63 100644
@@ -9,7 +9,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
Signature · 1 line
2.49.0
#5 lore raw

Re: [PATCH 2/2] iio: dummy: Drop unused export.h include.

Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

While this true...

Quoted 1 line

#include <linux/kernel.h>

...I prefer a full and not half-baked solution, i.e. revisiting all headers and esp. replacing kernel.h with what is used.

Quoted 4 lines

-#include <linux/export.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

While doing that, the headers may be sorted (in the same or preparatory patch).

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Re: [PATCH 2/2] iio: dummy: Drop unused export.h include.

Quoted 14 lines · On Mon, 9 Jun 2025 12:27:33 +0300 Andy Shevchenko <[email protected]>…
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

While this true...

Quoted 1 line

#include <linux/kernel.h>

...I prefer a full and not half-baked solution, i.e. revisiting all headers and esp. replacing kernel.h with what is used.

Quoted 7 lines
Quoted 4 lines

-#include <linux/export.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

While doing that, the headers may be sorted (in the same or preparatory patch).

Whilst I agree that more work is need, I also don't like the time it might take to get to it and the warnings that might mean more significant issues get missed in the wash in the meantime.

Jonathan

author maintainer
#7 lore raw

Re: [PATCH 2/2] iio: dummy: Drop unused export.h include.

Quoted 22 lines · On Mon, 9 Jun 2025 10:39:05 +0100 Jonathan Cameron…
Quoted 19 lines · On Mon, 9 Jun 2025 12:27:33 +0300 Andy Shevchenko <[email protected]>…
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

While this true...

Quoted 1 line

#include <linux/kernel.h>

...I prefer a full and not half-baked solution, i.e. revisiting all headers and esp. replacing kernel.h with what is used.

Quoted 4 lines

-#include <linux/export.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

Quoted 7 lines
Quoted 2 lines

While doing that, the headers may be sorted (in the same or preparatory patch).

Whilst I agree that more work is need, I also don't like the time it might take to get to it and the warnings that might mean more significant issues get missed in the wash in the meantime.

After I wrote this I remembered that this is our 'reference' code so we should hold it to a higher standard. So I'll try and come back and improve this one sometime soon rather than just papering over the cracks.

Given I tend to build with W=1 and right now I'm swamped with pages of these warnings I'm really keen to get rid of them in IIO anyway and I see lots of activity to squash them more generally.

I'm a bit grumpy that this warning got added without (as far as I saw) any attempt to first clean up upstream.

J

Quoted 2 lines

Jonathan

#8 lore raw

Re: [PATCH 2/2] iio: dummy: Drop unused export.h include.

Quoted 24 lines · Jonathan Cameron
Quoted 22 lines · On Mon, 9 Jun 2025 10:39:05 +0100 Jonathan Cameron…
Quoted 19 lines · On Mon, 9 Jun 2025 12:27:33 +0300 Andy Shevchenko <[email protected]>…
Quoted 4 lines · Jonathan Cameron

Resolves:
warning: EXPORT_SYMBOL() is not used, but #include <linux/export.h> is present

While this true...

Quoted 1 line

#include <linux/kernel.h>

...I prefer a full and not half-baked solution, i.e. revisiting all headers and esp. replacing kernel.h with what is used.

Quoted 4 lines

-#include <linux/export.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

While doing that, the headers may be sorted (in the same or preparatory patch).

Quoted 7 lines
Quoted 3 lines

Whilst I agree that more work is need, I also don't like the time it might take to get to it and the warnings that might mean more significant issues get missed in the wash in the meantime.

After I wrote this I remembered that this is our 'reference' code so we should hold it to a higher standard. So I'll try and come back and improve this one sometime soon rather than just papering over the cracks.

Right, I would actually add to whatever TODO exists (written or spelled :-) to replace kernel.h with the respective header(s) in whole IIO subsystem.

Quoted 3 lines

Given I tend to build with W=1 and right now I'm swamped with pages of these warnings I'm really keen to get rid of them in IIO anyway and I see lots of activity to squash them more generally.

I am frustrated not less than you, but here we are.

Quoted 2 lines

I'm a bit grumpy that this warning got added without (as far as I saw) any attempt to first clean up upstream.

This is not the first time something like this happened. Because it's make W=1 build, not many complain.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by on the v1 series
#9 lore raw
In reply to Jonathan Cameron
Quoted 12 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

7d95680d64ac8 ("scripts/misc-check: check unnecessary #include <linux/export.h> when W=1")
brings some new warnings about including export.h where it isn't used.

There are similar warnings where it is missing and should be present but more of those than I'm going to resolve this morning.

Jonathan

Quoted 8 lines

Jonathan Cameron (2):
  iio: potentiometer: Drop unused export.h includes
  iio: dummy: drop unused export.h include.

 drivers/iio/dummy/iio_simple_dummy_buffer.c | 1 - drivers/iio/potentiometer/ds1803.c          | 1 - drivers/iio/potentiometer/mcp4131.c         | 1 -

 3 files changed, 3 deletions(-)