Re: [PATCH] iio: gts-helper: fix error headers

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
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 <[email protected]>

> ---
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.