Re: [PATCH] iio: gts-helper: fix error headers
From: Andy Shevchenko
Date: Mon Aug 17 2026 - 03:47:37 EST
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@xxxxxxxxx>
> ---
> 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