[PATCH] gpiolib: add missing include

Bartosz Golaszewski posted 1 patch 2 years, 7 months ago
There is a newer version of this series
drivers/gpio/gpiolib.h | 1 +
1 file changed, 1 insertion(+)
[PATCH] gpiolib: add missing include
Posted by Bartosz Golaszewski 2 years, 7 months ago
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
Re: [PATCH] gpiolib: add missing include
Posted by Kent Gibson 2 years, 7 months ago
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
>
Re: [PATCH] gpiolib: add missing include
Posted by Bartosz Golaszewski 2 years, 7 months ago
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
> >
Re: [PATCH] gpiolib: add missing include
Posted by Kent Gibson 2 years, 7 months ago
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.
Re: [PATCH] gpiolib: add missing include
Posted by Bartosz Golaszewski 2 years, 7 months ago
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
Re: [PATCH] gpiolib: add missing include
Posted by Andy Shevchenko 2 years, 7 months ago
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