[v1,1/1] : iio: light: rpr0521: add missing Kconfig dependencies

Message ID 20221110144448.wexu6neb67krqhla@device
State New
Headers
Series [v1,1/1] : iio: light: rpr0521: add missing Kconfig dependencies |

Commit Message

Paul Gazzillo Nov. 10, 2022, 2:44 p.m. UTC
  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(+)
  

Comments

Andy Shevchenko Nov. 10, 2022, 3:42 p.m. UTC | #1
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)
  
Paul Gazzillo Nov. 10, 2022, 8:43 p.m. UTC | #2
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
  

Patch

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.