* [PATCH] iio: gts-helper: fix error headers
@ 2026-08-14 22:23 Javier Carrasco
2026-08-17 7:43 ` Andy Shevchenko
2026-08-17 11:03 ` Matti Vaittinen
0 siblings, 2 replies; 3+ messages in thread
From: Javier Carrasco @ 2026-08-14 22:23 UTC (permalink / raw)
To: Matti Vaittinen, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-iio, linux-kernel, Javier Carrasco
Both industrialio-gts-helper.c and iio-gts-helper.h use error codes
defined in <asm-generic/errno-base.h> (usually included via
<linux/errno.h>), but only industrialio-gts-helper.c includes it. On the
other hand, that file also uses error macros like IS_ERR() and
PTR_ERR(), which are included in <linux/err.h>.
Add the right includes to provide the used elements from the error
headers:
- <linux/errno.h> in iio-gts-helper.h
- <linux/err.h> in industrialio-gts-helper.c, which in turn includes
<asm/errno.h>, which only includes <asm-generic/errno-base.h>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
I stumbled upon this while refactoring veml6031x00.c
(which uses IIO GTS) just because clangd threw a couple of errors where
-EINVAL is returned in iio-gts-helper.h
In the end everything compiles anyway, and therefore I have not
added a "Fixes:" tag, but please let me know if that is really required
for something like this. It is also true that if the gts header is
included first, the compiler will throw the same error clangd showed me
and the kernel won't compile... Unlikely to ever happen, though.
I have compiled and tested this implementation with the driver I am
attempting to upstream without any issues.
---
| 2 +-
| 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
--git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c
index 4f52dc373abf..af6ed37fb34a 100644
--- a/drivers/iio/industrialio-gts-helper.c
+++ b/drivers/iio/industrialio-gts-helper.c
@@ -5,7 +5,7 @@
*/
#include <linux/device.h>
-#include <linux/errno.h>
+#include <linux/err.h>
#include <linux/export.h>
#include <linux/minmax.h>
#include <linux/module.h>
--git a/include/linux/iio/iio-gts-helper.h b/include/linux/iio/iio-gts-helper.h
index 66f830ab9b49..f63a482b82b8 100644
--- a/include/linux/iio/iio-gts-helper.h
+++ b/include/linux/iio/iio-gts-helper.h
@@ -7,6 +7,7 @@
#ifndef __IIO_GTS_HELPER__
#define __IIO_GTS_HELPER__
+#include <linux/errno.h>
#include <linux/types.h>
struct device;
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260814-iio-gts-err-headers-d7ecb6b5ebb7
Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] iio: gts-helper: fix error headers
2026-08-14 22:23 [PATCH] iio: gts-helper: fix error headers Javier Carrasco
@ 2026-08-17 7:43 ` Andy Shevchenko
2026-08-17 11:03 ` Matti Vaittinen
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-08-17 7:43 UTC (permalink / raw)
To: Javier Carrasco
Cc: Matti Vaittinen, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
On Sat, Aug 15, 2026 at 12:23:47AM +0200, Javier Carrasco wrote:
> Both industrialio-gts-helper.c and iio-gts-helper.h use error codes
> defined in <asm-generic/errno-base.h> (usually included via
> <linux/errno.h>), but only industrialio-gts-helper.c includes it. On the
> other hand, that file also uses error macros like IS_ERR() and
> PTR_ERR(), which are included in <linux/err.h>.
>
> Add the right includes to provide the used elements from the error
> headers:
>
> - <linux/errno.h> in iio-gts-helper.h
>
> - <linux/err.h> in industrialio-gts-helper.c, which in turn includes
> <asm/errno.h>, which only includes <asm-generic/errno-base.h>
Makes a perfect sense.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> ---
> I stumbled upon this while refactoring veml6031x00.c
> (which uses IIO GTS) just because clangd threw a couple of errors where
> -EINVAL is returned in iio-gts-helper.h
>
> In the end everything compiles anyway, and therefore I have not
> added a "Fixes:" tag, but please let me know if that is really required
> for something like this.
Yes, sounds good to me.
> It is also true that if the gts header is
> included first, the compiler will throw the same error clangd showed me
> and the kernel won't compile... Unlikely to ever happen, though.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: gts-helper: fix error headers
2026-08-14 22:23 [PATCH] iio: gts-helper: fix error headers Javier Carrasco
2026-08-17 7:43 ` Andy Shevchenko
@ 2026-08-17 11:03 ` Matti Vaittinen
1 sibling, 0 replies; 3+ messages in thread
From: Matti Vaittinen @ 2026-08-17 11:03 UTC (permalink / raw)
To: Javier Carrasco, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko
Cc: linux-iio, linux-kernel
On 15/08/2026 01:23, Javier Carrasco wrote:
> Both industrialio-gts-helper.c and iio-gts-helper.h use error codes
> defined in <asm-generic/errno-base.h> (usually included via
> <linux/errno.h>), but only industrialio-gts-helper.c includes it. On the
> other hand, that file also uses error macros like IS_ERR() and
> PTR_ERR(), which are included in <linux/err.h>.
>
> Add the right includes to provide the used elements from the error
> headers:
>
> - <linux/errno.h> in iio-gts-helper.h
>
> - <linux/err.h> in industrialio-gts-helper.c, which in turn includes
> <asm/errno.h>, which only includes <asm-generic/errno-base.h>
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
> I stumbled upon this while refactoring veml6031x00.c
> (which uses IIO GTS) just because clangd threw a couple of errors where
> -EINVAL is returned in iio-gts-helper.h
>
> In the end everything compiles anyway, and therefore I have not
> added a "Fixes:" tag, but please let me know if that is really required
> for something like this. It is also true that if the gts header is
> included first, the compiler will throw the same error clangd showed me
> and the kernel won't compile... Unlikely to ever happen, though.
Unlikely or not, this sounds like an error to me. Hence, I don't think a
fixes-tag would be wrong either.
Anyways - thanks!
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
>
> I have compiled and tested this implementation with the driver I am
> attempting to upstream without any issues.
> ---
> drivers/iio/industrialio-gts-helper.c | 2 +-
> include/linux/iio/iio-gts-helper.h | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/industrialio-gts-helper.c b/drivers/iio/industrialio-gts-helper.c
> index 4f52dc373abf..af6ed37fb34a 100644
> --- a/drivers/iio/industrialio-gts-helper.c
> +++ b/drivers/iio/industrialio-gts-helper.c
> @@ -5,7 +5,7 @@
> */
>
> #include <linux/device.h>
> -#include <linux/errno.h>
> +#include <linux/err.h>
> #include <linux/export.h>
> #include <linux/minmax.h>
> #include <linux/module.h>
> diff --git a/include/linux/iio/iio-gts-helper.h b/include/linux/iio/iio-gts-helper.h
> index 66f830ab9b49..f63a482b82b8 100644
> --- a/include/linux/iio/iio-gts-helper.h
> +++ b/include/linux/iio/iio-gts-helper.h
> @@ -7,6 +7,7 @@
> #ifndef __IIO_GTS_HELPER__
> #define __IIO_GTS_HELPER__
>
> +#include <linux/errno.h>
> #include <linux/types.h>
>
> struct device;
>
> ---
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> change-id: 20260814-iio-gts-err-headers-d7ecb6b5ebb7
>
> Best regards,
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-17 11:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-14 22:23 [PATCH] iio: gts-helper: fix error headers Javier Carrasco
2026-08-17 7:43 ` Andy Shevchenko
2026-08-17 11:03 ` Matti Vaittinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®