linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
@ 2022-11-10 14:44 Paul Gazzillo
  2022-11-10 15:42 ` Andy Shevchenko
  2022-11-10 21:47 ` [PATCH v2 " Paul Gazzillo
  0 siblings, 2 replies; 8+ messages in thread
From: Paul Gazzillo @ 2022-11-10 14:44 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Andy Shevchenko,
	Shreeya Patel, Zhigang Shi, Dmitry Osipenko
  Cc: linux-iio, linux-kernel

Steps to reproduce (v6.1-rc2, x86_64):

1. make defconfig menuconfig
2. Enable the driver:
    -> Device Drivers
      -> Industrial I/O support (IIO [=y])
        -> Light sensors
          -> ROHM RPR0521 ALS and proximity sensor driver
3. make drivers/iio/light/rpr0521.o

Causes "implicit declaration of function" errors, e.g.,

    CC      drivers/iio/light/rpr0521.o
  drivers/iio/light/rpr0521.c: In function 'rpr0521_drdy_irq_thread':
  drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
           'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
    434 |   iio_trigger_poll_chained(data->drdy_trigger0);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~

(This bug was found with the help of a tool, krepair, that generates
configuration files for commits: https://github.com/paulgazz/kmax)

The following patch ensures that the code controlled by IIO_BUFFER and
IIO_TRIGGERED_BUFFER is available:

Reported-by: Paul Gazzillo <paul@pgazz.com>
---
 drivers/iio/light/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
index 7cf6e8490123..0d4447df7200 100644
--- a/drivers/iio/light/Kconfig
+++ b/drivers/iio/light/Kconfig
@@ -293,6 +293,8 @@ config RPR0521
 	tristate "ROHM RPR0521 ALS and proximity sensor driver"
 	depends on I2C
 	select REGMAP_I2C
+	select IIO_BUFFER
+	select IIO_TRIGGERED_BUFFER
 	help
 	  Say Y here if you want to build support for ROHM's RPR0521
 	  ambient light and proximity sensor device.
-- 
2.25.1

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

* Re: [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-10 14:44 [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies Paul Gazzillo
@ 2022-11-10 15:42 ` Andy Shevchenko
  2022-11-10 20:43   ` Paul Gazzillo
  2022-11-10 21:47 ` [PATCH v2 " Paul Gazzillo
  1 sibling, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2022-11-10 15:42 UTC (permalink / raw)
  To: Paul Gazzillo
  Cc: Jonathan Cameron, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel

On Thu, Nov 10, 2022 at 09:44:48AM -0500, Paul Gazzillo wrote:
> Steps to reproduce (v6.1-rc2, x86_64):
> 
> 1. make defconfig menuconfig
> 2. Enable the driver:
>     -> Device Drivers
>       -> Industrial I/O support (IIO [=y])
>         -> Light sensors
>           -> ROHM RPR0521 ALS and proximity sensor driver
> 3. make drivers/iio/light/rpr0521.o
> 
> Causes "implicit declaration of function" errors, e.g.,

>     CC      drivers/iio/light/rpr0521.o
>   drivers/iio/light/rpr0521.c: In function 'rpr0521_drdy_irq_thread':

These two lines can be removed.

>   drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
>            'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
>     434 |   iio_trigger_poll_chained(data->drdy_trigger0);
>         |   ^~~~~~~~~~~~~~~~~~~~~~~~

> (This bug was found with the help of a tool, krepair, that generates
> configuration files for commits: https://github.com/paulgazz/kmax)

I'm not sure we need this in the commit message. Do we have a tag for
the static analyzers?

> The following patch ensures that the code controlled by IIO_BUFFER and
> IIO_TRIGGERED_BUFFER is available:

> Reported-by: Paul Gazzillo <paul@pgazz.com>

Without SoB this may not be anyhow proceeded. Please, read Submitting Patches
documentation and try again.

(Btw, Reported-by above contradicts the commit message that refers to the tool,
 and not human)

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-10 15:42 ` Andy Shevchenko
@ 2022-11-10 20:43   ` Paul Gazzillo
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Gazzillo @ 2022-11-10 20:43 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel


On 11/10/2022, Andy Shevchenko wrote:
> On Thu, Nov 10, 2022 at 09:44:48AM -0500, Paul Gazzillo wrote:
> 
> >     CC      drivers/iio/light/rpr0521.o
> >   drivers/iio/light/rpr0521.c: In function 'rpr0521_drdy_irq_thread':
> 
> These two lines can be removed.

Will do.

> > (This bug was found with the help of a tool, krepair, that generates
> > configuration files for commits: https://github.com/paulgazz/kmax)
> 
> I'm not sure we need this in the commit message. Do we have a tag for
> the static analyzers?

I'll also remove this.

> > The following patch ensures that the code controlled by IIO_BUFFER and
> > IIO_TRIGGERED_BUFFER is available:
> 
> > Reported-by: Paul Gazzillo <paul@pgazz.com>
> 
> Without SoB this may not be anyhow proceeded. Please, read Submitting Patches
> documentation and try again.
> 
> (Btw, Reported-by above contradicts the commit message that refers to the tool,
>  and not human)

Apologies, I was confused about whether I or the maintainer fills that
out.  Will submit a new version with SoB.

Thanks!
Paul

> 
> -- 
> With Best Regards,
> Andy Shevchenko

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

* [PATCH v2 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-10 14:44 [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies Paul Gazzillo
  2022-11-10 15:42 ` Andy Shevchenko
@ 2022-11-10 21:47 ` Paul Gazzillo
  2022-11-11 11:25   ` Andy Shevchenko
  1 sibling, 1 reply; 8+ messages in thread
From: Paul Gazzillo @ 2022-11-10 21:47 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Andy Shevchenko,
	Shreeya Patel, Zhigang Shi, Dmitry Osipenko
  Cc: linux-iio, linux-kernel

Fix an implicit declaration of function error for rpr0521 under some configs

When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER,
the build results in "implicit declaration of function" errors, e.g.,
  drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
           'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
    434 |   iio_trigger_poll_chained(data->drdy_trigger0);
        |   ^~~~~~~~~~~~~~~~~~~~~~~~

This fix adds select dependencies to RPR0521's configuration declaration.

Signed-off-by: Paul Gazzillo <paul@pgazz.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678
---
V1 -> V2: Cleaned up commit message per reviewer comments and added link
          to bug report.

 drivers/iio/light/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
index 7cf6e8490123..0d4447df7200 100644
--- a/drivers/iio/light/Kconfig
+++ b/drivers/iio/light/Kconfig
@@ -293,6 +293,8 @@ config RPR0521
 	tristate "ROHM RPR0521 ALS and proximity sensor driver"
 	depends on I2C
 	select REGMAP_I2C
+	select IIO_BUFFER
+	select IIO_TRIGGERED_BUFFER
 	help
 	  Say Y here if you want to build support for ROHM's RPR0521
 	  ambient light and proximity sensor device.
-- 
2.25.1

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

* Re: [PATCH v2 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-10 21:47 ` [PATCH v2 " Paul Gazzillo
@ 2022-11-11 11:25   ` Andy Shevchenko
  2022-11-11 15:25     ` Paul Gazzillo
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2022-11-11 11:25 UTC (permalink / raw)
  To: Paul Gazzillo
  Cc: Jonathan Cameron, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel

On Thu, Nov 10, 2022 at 04:47:29PM -0500, Paul Gazzillo wrote:
> Fix an implicit declaration of function error for rpr0521 under some configs
> 
> When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER,
> the build results in "implicit declaration of function" errors, e.g.,
>   drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
>            'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
>     434 |   iio_trigger_poll_chained(data->drdy_trigger0);
>         |   ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> This fix adds select dependencies to RPR0521's configuration declaration.
> 
> Signed-off-by: Paul Gazzillo <paul@pgazz.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678

No need to create a bugzilla report on such tiny issues that do actually not
affect the working configurations.

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

> ---
> V1 -> V2: Cleaned up commit message per reviewer comments and added link
>           to bug report.
> 
>  drivers/iio/light/Kconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
> index 7cf6e8490123..0d4447df7200 100644
> --- a/drivers/iio/light/Kconfig
> +++ b/drivers/iio/light/Kconfig
> @@ -293,6 +293,8 @@ config RPR0521
>  	tristate "ROHM RPR0521 ALS and proximity sensor driver"
>  	depends on I2C
>  	select REGMAP_I2C
> +	select IIO_BUFFER
> +	select IIO_TRIGGERED_BUFFER
>  	help
>  	  Say Y here if you want to build support for ROHM's RPR0521
>  	  ambient light and proximity sensor device.
> -- 
> 2.25.1

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v2 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-11 11:25   ` Andy Shevchenko
@ 2022-11-11 15:25     ` Paul Gazzillo
  2022-11-12 17:37       ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Gazzillo @ 2022-11-11 15:25 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel

On 11/11/2022, Andy Shevchenko wrote:
> On Thu, Nov 10, 2022 at 04:47:29PM -0500, Paul Gazzillo wrote:
> > Fix an implicit declaration of function error for rpr0521 under some configs
> > 
> > When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER,
> > the build results in "implicit declaration of function" errors, e.g.,
> >   drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
> >            'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
> >     434 |   iio_trigger_poll_chained(data->drdy_trigger0);
> >         |   ^~~~~~~~~~~~~~~~~~~~~~~~
> > 
> > This fix adds select dependencies to RPR0521's configuration declaration.
> > 
> > Signed-off-by: Paul Gazzillo <paul@pgazz.com>
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678
> 
> No need to create a bugzilla report on such tiny issues that do actually not
> affect the working configurations.

Understood.  Thanks for your help!

> 
> FWIW,
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> > ---
> > V1 -> V2: Cleaned up commit message per reviewer comments and added link
> >           to bug report.
> > 
> >  drivers/iio/light/Kconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
> > index 7cf6e8490123..0d4447df7200 100644
> > --- a/drivers/iio/light/Kconfig
> > +++ b/drivers/iio/light/Kconfig
> > @@ -293,6 +293,8 @@ config RPR0521
> >  	tristate "ROHM RPR0521 ALS and proximity sensor driver"
> >  	depends on I2C
> >  	select REGMAP_I2C
> > +	select IIO_BUFFER
> > +	select IIO_TRIGGERED_BUFFER
> >  	help
> >  	  Say Y here if you want to build support for ROHM's RPR0521
> >  	  ambient light and proximity sensor device.
> > -- 
> > 2.25.1
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Best,
Paul

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

* Re: [PATCH v2 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-11 15:25     ` Paul Gazzillo
@ 2022-11-12 17:37       ` Jonathan Cameron
  2022-11-14 16:22         ` Paul Gazzillo
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Cameron @ 2022-11-12 17:37 UTC (permalink / raw)
  To: Paul Gazzillo
  Cc: Andy Shevchenko, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel

On Fri, 11 Nov 2022 10:25:39 -0500
Paul Gazzillo <paul@pgazz.com> wrote:

> On 11/11/2022, Andy Shevchenko wrote:
> > On Thu, Nov 10, 2022 at 04:47:29PM -0500, Paul Gazzillo wrote:  
> > > Fix an implicit declaration of function error for rpr0521 under some configs
> > > 
> > > When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER,
> > > the build results in "implicit declaration of function" errors, e.g.,
> > >   drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
> > >            'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
> > >     434 |   iio_trigger_poll_chained(data->drdy_trigger0);
> > >         |   ^~~~~~~~~~~~~~~~~~~~~~~~
> > > 
> > > This fix adds select dependencies to RPR0521's configuration declaration.
> > > 
> > > Signed-off-by: Paul Gazzillo <paul@pgazz.com>
> > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678  
> > 
> > No need to create a bugzilla report on such tiny issues that do actually not
> > affect the working configurations.  
> 
> Understood.  Thanks for your help!

I wonder why it has taken so long for this build issue to get reported?

Ah well. This is missing a fixes tag. I added
Fixes: e12ffd241c00 ("iio: light: rpr0521 triggered buffer")

Applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan



> 
> > 
> > FWIW,
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >   
> > > ---
> > > V1 -> V2: Cleaned up commit message per reviewer comments and added link
> > >           to bug report.
> > > 
> > >  drivers/iio/light/Kconfig | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
> > > index 7cf6e8490123..0d4447df7200 100644
> > > --- a/drivers/iio/light/Kconfig
> > > +++ b/drivers/iio/light/Kconfig
> > > @@ -293,6 +293,8 @@ config RPR0521
> > >  	tristate "ROHM RPR0521 ALS and proximity sensor driver"
> > >  	depends on I2C
> > >  	select REGMAP_I2C
> > > +	select IIO_BUFFER
> > > +	select IIO_TRIGGERED_BUFFER
> > >  	help
> > >  	  Say Y here if you want to build support for ROHM's RPR0521
> > >  	  ambient light and proximity sensor device.
> > > -- 
> > > 2.25.1  
> > 
> > -- 
> > With Best Regards,
> > Andy Shevchenko  
> 
> Best,
> Paul


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

* Re: [PATCH v2 1/1]: iio: light: rpr0521: add missing Kconfig dependencies
  2022-11-12 17:37       ` Jonathan Cameron
@ 2022-11-14 16:22         ` Paul Gazzillo
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Gazzillo @ 2022-11-14 16:22 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Andy Shevchenko, Lars-Peter Clausen, Shreeya Patel, Zhigang Shi,
	Dmitry Osipenko, linux-iio, linux-kernel

On 11/12/2022, Jonathan Cameron wrote:
> On Fri, 11 Nov 2022 10:25:39 -0500
> Paul Gazzillo <paul@pgazz.com> wrote:
> 
> > On 11/11/2022, Andy Shevchenko wrote:
> > > On Thu, Nov 10, 2022 at 04:47:29PM -0500, Paul Gazzillo wrote:  
> > > > Fix an implicit declaration of function error for rpr0521 under some configs
> > > > 
> > > > When CONFIG_RPR0521 is enabled without CONFIG_IIO_TRIGGERED_BUFFER,
> > > > the build results in "implicit declaration of function" errors, e.g.,
> > > >   drivers/iio/light/rpr0521.c:434:3: error: implicit declaration of function
> > > >            'iio_trigger_poll_chained' [-Werror=implicit-function-declaration]
> > > >     434 |   iio_trigger_poll_chained(data->drdy_trigger0);
> > > >         |   ^~~~~~~~~~~~~~~~~~~~~~~~
> > > > 
> > > > This fix adds select dependencies to RPR0521's configuration declaration.
> > > > 
> > > > Signed-off-by: Paul Gazzillo <paul@pgazz.com>
> > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216678  
> > > 
> > > No need to create a bugzilla report on such tiny issues that do actually not
> > > affect the working configurations.  
> > 
> > Understood.  Thanks for your help!
> 
> I wonder why it has taken so long for this build issue to get reported?
>

There seem to be lots of combinations of configuration options that
don't get tested or even built (understandably, given the enormous
number of options), leaving Kconfig with an incomplete picture of
dependencies.  There's just too many to test, though if users are only
using some predefined .config files (or testers are using only
allyesconfig) they may not encounter these corner cases that slip
through Kconfig (and maybe these cases aren't really very high
impact).  Our team's been researching how to better test across
configurations; one of our tools for finding unmet Kconfig dependency
bugs (kismet) is now being run by Intel's kernel test robot, but we're
also working on how to improve run-time testing as well, and I ran
across a configuration that triggered this build error.  In case
you're interested, here's our current tooling:
    https://github.com/paulgazz/kmax
Let me know if you have any related painpoints that this work might
help with.  I work in academia with funding that encourages
open-sourcing the results, so it's great to have real-world problems
that can provide a tangible benefit.

> Ah well. This is missing a fixes tag. I added
> Fixes: e12ffd241c00 ("iio: light: rpr0521 triggered buffer")

Thank you!

> 
> Applied to the fixes-togreg branch of iio.git.
>
> Thanks,
> 
> Jonathan
> 
> 
> 
> > 
> > > 
> > > FWIW,
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > >   
> > > > ---
> > > > V1 -> V2: Cleaned up commit message per reviewer comments and added link
> > > >           to bug report.
> > > > 
> > > >  drivers/iio/light/Kconfig | 2 ++
> > > >  1 file changed, 2 insertions(+)
> > > > 
> > > > diff --git a/drivers/iio/light/Kconfig b/drivers/iio/light/Kconfig
> > > > index 7cf6e8490123..0d4447df7200 100644
> > > > --- a/drivers/iio/light/Kconfig
> > > > +++ b/drivers/iio/light/Kconfig
> > > > @@ -293,6 +293,8 @@ config RPR0521
> > > >  	tristate "ROHM RPR0521 ALS and proximity sensor driver"
> > > >  	depends on I2C
> > > >  	select REGMAP_I2C
> > > > +	select IIO_BUFFER
> > > > +	select IIO_TRIGGERED_BUFFER
> > > >  	help
> > > >  	  Say Y here if you want to build support for ROHM's RPR0521
> > > >  	  ambient light and proximity sensor device.
> > > > -- 
> > > > 2.25.1  
> > > 
> > > -- 
> > > With Best Regards,
> > > Andy Shevchenko  
> > 
> > Best,
> > Paul

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

end of thread, other threads:[~2022-11-14 16:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 14:44 [PATCH v1 1/1]: iio: light: rpr0521: add missing Kconfig dependencies Paul Gazzillo
2022-11-10 15:42 ` Andy Shevchenko
2022-11-10 20:43   ` Paul Gazzillo
2022-11-10 21:47 ` [PATCH v2 " Paul Gazzillo
2022-11-11 11:25   ` Andy Shevchenko
2022-11-11 15:25     ` Paul Gazzillo
2022-11-12 17:37       ` Jonathan Cameron
2022-11-14 16:22         ` Paul Gazzillo

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