linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: add missing include
@ 2023-07-05  7:42 Bartosz Golaszewski
  2023-07-05 10:57 ` Kent Gibson
  2023-07-06  9:34 ` Andy Shevchenko
  0 siblings, 2 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2023-07-05  7:42 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpiolib.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
index cca81375f127..1409d52487c0 100644
--- a/drivers/gpio/gpiolib.h
+++ b/drivers/gpio/gpiolib.h
@@ -14,6 +14,7 @@
 #include <linux/err.h>
 #include <linux/device.h>
 #include <linux/module.h>
+#include <linux/notifier.h>
 #include <linux/cdev.h>
 #include <linux/rwsem.h>
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2023-07-05  7:42 Bartosz Golaszewski
@ 2023-07-05 10:57 ` Kent Gibson
  2023-07-05 10:59   ` Bartosz Golaszewski
  2023-07-06  9:34 ` Andy Shevchenko
  1 sibling, 1 reply; 8+ messages in thread
From: Kent Gibson @ 2023-07-05 10:57 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel,
	Bartosz Golaszewski

On Wed, Jul 05, 2023 at 09:42:19AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.
> 

Fair enough.

Reviewed-by: Kent Gibson <warthog618@gmail.com>

Same is true for gpiolib-cdev, btw.
You want to touch that one up as well?

Cheers,
Kent.

> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/gpio/gpiolib.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index cca81375f127..1409d52487c0 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -14,6 +14,7 @@
>  #include <linux/err.h>
>  #include <linux/device.h>
>  #include <linux/module.h>
> +#include <linux/notifier.h>
>  #include <linux/cdev.h>
>  #include <linux/rwsem.h>
>  
> -- 
> 2.39.2
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2023-07-05 10:57 ` Kent Gibson
@ 2023-07-05 10:59   ` Bartosz Golaszewski
  2023-07-05 11:05     ` Kent Gibson
  0 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2023-07-05 10:59 UTC (permalink / raw)
  To: Kent Gibson
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel,
	Bartosz Golaszewski

On Wed, Jul 5, 2023 at 12:57 PM Kent Gibson <warthog618@gmail.com> wrote:
>
> On Wed, Jul 05, 2023 at 09:42:19AM +0200, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> >
> > gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.
> >
>
> Fair enough.
>
> Reviewed-by: Kent Gibson <warthog618@gmail.com>
>
> Same is true for gpiolib-cdev, btw.
> You want to touch that one up as well?
>

No, it already includes gpiolib.h.

Bart

> Cheers,
> Kent.
>
> > Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > ---
> >  drivers/gpio/gpiolib.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> > index cca81375f127..1409d52487c0 100644
> > --- a/drivers/gpio/gpiolib.h
> > +++ b/drivers/gpio/gpiolib.h
> > @@ -14,6 +14,7 @@
> >  #include <linux/err.h>
> >  #include <linux/device.h>
> >  #include <linux/module.h>
> > +#include <linux/notifier.h>
> >  #include <linux/cdev.h>
> >  #include <linux/rwsem.h>
> >
> > --
> > 2.39.2
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2023-07-05 10:59   ` Bartosz Golaszewski
@ 2023-07-05 11:05     ` Kent Gibson
  2023-07-05 11:58       ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Kent Gibson @ 2023-07-05 11:05 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel,
	Bartosz Golaszewski

On Wed, Jul 05, 2023 at 12:59:19PM +0200, Bartosz Golaszewski wrote:
> On Wed, Jul 5, 2023 at 12:57 PM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > On Wed, Jul 05, 2023 at 09:42:19AM +0200, Bartosz Golaszewski wrote:
> > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > >
> > > gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.
> > >
> >
> > Fair enough.
> >
> > Reviewed-by: Kent Gibson <warthog618@gmail.com>
> >
> > Same is true for gpiolib-cdev, btw.
> > You want to touch that one up as well?
> >
> 
> No, it already includes gpiolib.h.
> 

Yeah, but that is indirect, and gpiolib-cdev.c uses struct notifier_block
directly.  Doesn't that warrant an explicit include?

Cheers,
Kent.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2023-07-05 11:05     ` Kent Gibson
@ 2023-07-05 11:58       ` Bartosz Golaszewski
  0 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2023-07-05 11:58 UTC (permalink / raw)
  To: Kent Gibson
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel,
	Bartosz Golaszewski

On Wed, Jul 5, 2023 at 1:05 PM Kent Gibson <warthog618@gmail.com> wrote:
>
> On Wed, Jul 05, 2023 at 12:59:19PM +0200, Bartosz Golaszewski wrote:
> > On Wed, Jul 5, 2023 at 12:57 PM Kent Gibson <warthog618@gmail.com> wrote:
> > >
> > > On Wed, Jul 05, 2023 at 09:42:19AM +0200, Bartosz Golaszewski wrote:
> > > > From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> > > >
> > > > gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.
> > > >
> > >
> > > Fair enough.
> > >
> > > Reviewed-by: Kent Gibson <warthog618@gmail.com>
> > >
> > > Same is true for gpiolib-cdev, btw.
> > > You want to touch that one up as well?
> > >
> >
> > No, it already includes gpiolib.h.
> >
>
> Yeah, but that is indirect, and gpiolib-cdev.c uses struct notifier_block
> directly.  Doesn't that warrant an explicit include?
>
> Cheers,
> Kent.

Then gpiolib.c would need one too. IMO it's fine to just have it in
gpiolib.h. It's a gpio-local header included by all core .c files.

Bart

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2023-07-05  7:42 Bartosz Golaszewski
  2023-07-05 10:57 ` Kent Gibson
@ 2023-07-06  9:34 ` Andy Shevchenko
  1 sibling, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2023-07-06  9:34 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linus Walleij, linux-gpio, linux-kernel, Bartosz Golaszewski

On Wed, Jul 05, 2023 at 09:42:19AM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> gpiolib.h uses notifiers but doesn't include <linux/notifier.h>.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  drivers/gpio/gpiolib.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index cca81375f127..1409d52487c0 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -14,6 +14,7 @@
>  #include <linux/err.h>
>  #include <linux/device.h>
>  #include <linux/module.h>
> +#include <linux/notifier.h>
>  #include <linux/cdev.h>
>  #include <linux/rwsem.h>

Can you also sort them (maybe in a separate change)?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] gpiolib: add missing include
@ 2025-02-07  8:30 Bartosz Golaszewski
  2025-02-07 20:33 ` Bartosz Golaszewski
  0 siblings, 1 reply; 8+ messages in thread
From: Bartosz Golaszewski @ 2025-02-07  8:30 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

With some randconfigs I'm seeing the following error:

In file included from drivers/gpio/gpiolib-swnode.c:19:
./include/linux/gpio/consumer.h: In function ‘gpiod_enable_hw_timestamp_ns’:
./include/linux/gpio/consumer.h:557:17: error: implicit declaration of function ‘WARN_ON’ [-Wimplicit-function-declaration]
  557 |                 WARN_ON(desc);
      |                 ^~~~~~~

Pull in bug.h to fix it.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 include/linux/gpio/consumer.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index db2dfbae8edb..0b1acd014186 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -3,6 +3,7 @@
 #define __LINUX_GPIO_CONSUMER_H
 
 #include <linux/bits.h>
+#include <linux/bug.h>
 #include <linux/types.h>
 
 struct acpi_device;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] gpiolib: add missing include
  2025-02-07  8:30 [PATCH] gpiolib: add missing include Bartosz Golaszewski
@ 2025-02-07 20:33 ` Bartosz Golaszewski
  0 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2025-02-07 20:33 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski

On Fri, Feb 7, 2025 at 9:30 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> With some randconfigs I'm seeing the following error:
>
> In file included from drivers/gpio/gpiolib-swnode.c:19:
> ./include/linux/gpio/consumer.h: In function ‘gpiod_enable_hw_timestamp_ns’:
> ./include/linux/gpio/consumer.h:557:17: error: implicit declaration of function ‘WARN_ON’ [-Wimplicit-function-declaration]
>   557 |                 WARN_ON(desc);
>       |                 ^~~~~~~
>
> Pull in bug.h to fix it.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> ---
>  include/linux/gpio/consumer.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
> index db2dfbae8edb..0b1acd014186 100644
> --- a/include/linux/gpio/consumer.h
> +++ b/include/linux/gpio/consumer.h
> @@ -3,6 +3,7 @@
>  #define __LINUX_GPIO_CONSUMER_H
>
>  #include <linux/bits.h>
> +#include <linux/bug.h>
>  #include <linux/types.h>
>
>  struct acpi_device;
> --
> 2.45.2
>

Ah, build bot responding to my CONFIG_HTE patch made me realize we
already include asm/bug.h for !CONFIG_GPIOLIB. I'll rethink the
approach here as we'll need it for the HTE stubs too.

Bart

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-02-07 20:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07  8:30 [PATCH] gpiolib: add missing include Bartosz Golaszewski
2025-02-07 20:33 ` Bartosz Golaszewski
  -- strict thread matches above, loose matches on Subject: below --
2023-07-05  7:42 Bartosz Golaszewski
2023-07-05 10:57 ` Kent Gibson
2023-07-05 10:59   ` Bartosz Golaszewski
2023-07-05 11:05     ` Kent Gibson
2023-07-05 11:58       ` Bartosz Golaszewski
2023-07-06  9:34 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).