linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drivers: iio: max1027: Fix sparse warning: "dubious: x | !y"
@ 2016-09-23 20:04 Sandhya Bankar
  2016-09-24 16:12 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Sandhya Bankar @ 2016-09-23 20:04 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, linux-iio

Fixing below warning:
drivers/iio/adc/max1027.c:241:34: warning: dubious: x | !y .

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
Changes in v2:
* Using MAX1027_TEMP instead of number.

 drivers/iio/adc/max1027.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 712fbd2..d601818 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -238,7 +238,9 @@ static int max1027_read_single_value(struct iio_dev *indio_dev,
 
 	/* Configure conversion register with the requested chan */
 	st->reg = MAX1027_CONV_REG | MAX1027_CHAN(chan->channel) |
-		  MAX1027_NOSCAN | !!(chan->type == IIO_TEMP);
+		  MAX1027_NOSCAN;
+	if (chan->type == IIO_TEMP)
+		st->reg |= MAX1027_TEMP;
 	ret = spi_write(st->spi, &st->reg, 1);
 	if (ret < 0) {
 		dev_err(&indio_dev->dev,
-- 
1.8.3.1


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

* Re: [PATCH v2] drivers: iio: max1027: Fix sparse warning: "dubious: x | !y"
  2016-09-23 20:04 [PATCH v2] drivers: iio: max1027: Fix sparse warning: "dubious: x | !y" Sandhya Bankar
@ 2016-09-24 16:12 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2016-09-24 16:12 UTC (permalink / raw)
  To: Sandhya Bankar, knaack.h, lars, pmeerw, linux-iio

On 23/09/16 21:04, Sandhya Bankar wrote:
> Fixing below warning:
> drivers/iio/adc/max1027.c:241:34: warning: dubious: x | !y .
> 
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> Changes in v2:
> * Using MAX1027_TEMP instead of number.
> 
>  drivers/iio/adc/max1027.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 712fbd2..d601818 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -238,7 +238,9 @@ static int max1027_read_single_value(struct iio_dev *indio_dev,
>  
>  	/* Configure conversion register with the requested chan */
>  	st->reg = MAX1027_CONV_REG | MAX1027_CHAN(chan->channel) |
> -		  MAX1027_NOSCAN | !!(chan->type == IIO_TEMP);
> +		  MAX1027_NOSCAN;
> +	if (chan->type == IIO_TEMP)
> +		st->reg |= MAX1027_TEMP;
>  	ret = spi_write(st->spi, &st->reg, 1);
>  	if (ret < 0) {
>  		dev_err(&indio_dev->dev,
> 


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

end of thread, other threads:[~2016-09-24 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-23 20:04 [PATCH v2] drivers: iio: max1027: Fix sparse warning: "dubious: x | !y" Sandhya Bankar
2016-09-24 16:12 ` Jonathan Cameron

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