mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: "Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: gts-helper: fix error headers
Date: Wed, 19 Aug 2026 02:07:15 +0100	[thread overview]
Message-ID: <20260819020715.3789082d@jic23-huawei> (raw)
In-Reply-To: <7155f6fd-435a-4176-aa9a-79888e0b5ccc@gmail.com>

On Mon, 17 Aug 2026 14:03:53 +0300
Matti Vaittinen <mazziesaccount@gmail.com> wrote:

> 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>
> 

Applied (without fixes tag - not known to be a problem right now and these
sort of things are really common) to the testing branch of iio.git

Thanks,

Jonathan

> > 
> > 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,  
> 
> 


      reply	other threads:[~2026-08-19  1:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 22:23 Javier Carrasco
2026-08-17  7:43 ` Andy Shevchenko
2026-08-17 11:03 ` Matti Vaittinen
2026-08-19  1:07   ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260819020715.3789082d@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®