diff mbox series

[4/4] iio:adc:ad7923: Rewrite comparison to NULL

Message ID 20190222203159.15116-5-barbara.fernandes@usp.br (mailing list archive)
State New, archived
Headers show
Series Solve checkstyle problems | expand

Commit Message

Bárbara Fernandes Feb. 22, 2019, 8:31 p.m. UTC
Solves checkpath.pl's message:

CHECK: Comparison to NULL could be written "!indio_dev"

Signed-off-by: Bárbara Fernandes <barbara.fernandes@usp.br>
---
 drivers/iio/adc/ad7923.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron March 3, 2019, 2:47 p.m. UTC | #1
On Fri, 22 Feb 2019 17:31:59 -0300
Bárbara Fernandes <barbara.fernandes@usp.br> wrote:

> Solves checkpath.pl's message:
> 
> CHECK: Comparison to NULL could be written "!indio_dev"
> 
> Signed-off-by: Bárbara Fernandes <barbara.fernandes@usp.br>
Applied, thanks.

It's nice to get some cleanup for drivers that aren't in staging
sometimes.  After all, in recent years the kernel coding style
and tools to check it have improved considerably.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad7923.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> index dbece44e26e4..cb7b854df00c 100644
> --- a/drivers/iio/adc/ad7923.c
> +++ b/drivers/iio/adc/ad7923.c
> @@ -272,7 +272,7 @@ static int ad7923_probe(struct spi_device *spi)
>  	int ret;
>  
>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> -	if (indio_dev == NULL)
> +	if (!indio_dev)
>  		return -ENOMEM;
>  
>  	st = iio_priv(indio_dev);
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
index dbece44e26e4..cb7b854df00c 100644
--- a/drivers/iio/adc/ad7923.c
+++ b/drivers/iio/adc/ad7923.c
@@ -272,7 +272,7 @@  static int ad7923_probe(struct spi_device *spi)
 	int ret;
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-	if (indio_dev == NULL)
+	if (!indio_dev)
 		return -ENOMEM;
 
 	st = iio_priv(indio_dev);