diff mbox

Drivers:iio:dac: Remove unneeded conversion to bool

Message ID 1515067092-5219-1-git-send-email-venkat.prashanth2498@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

venkat.prashanth2498@gmail.com Jan. 4, 2018, 11:58 a.m. UTC
From: Venkat Prashanth B U <venkat.prashanth2498@gmail.com>

This is a patch to the mcp4725.c file which
fixes the following coccinelle warning:

WARNING: conversion to bool not needed here

Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com>
---
 drivers/iio/dac/mcp4725.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Lars-Peter Clausen Jan. 4, 2018, 12:54 p.m. UTC | #1
On 01/04/2018 12:58 PM, venkat.prashanth2498@gmail.com wrote:
> From: Venkat Prashanth B U <venkat.prashanth2498@gmail.com>
> 
> This is a patch to the mcp4725.c file which
> fixes the following coccinelle warning:
> 
> WARNING: conversion to bool not needed here
> 
> Signed-off-by: Venkat Prashanth B U <venkat.prashanth2498@gmail.com>
> ---
>  drivers/iio/dac/mcp4725.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> index afa856d..8f8c529 100644
> --- a/drivers/iio/dac/mcp4725.c
> +++ b/drivers/iio/dac/mcp4725.c
> @@ -476,7 +476,6 @@ static int mcp4725_probe(struct i2c_client *client,
>  		goto err_disable_vref_reg;
>  	}
>  	pd = (inbuf[0] >> 1) & 0x3;
> -	data->powerdown = pd > 0 ? true : false;

You removed the complete statement. Not just the conversion to bool.

>  	data->powerdown_mode = pd ? pd - 1 : 2; /* largest resistor to gnd */
>  	data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4);
>  	if (data->id == MCP4726)
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index afa856d..8f8c529 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -476,7 +476,6 @@  static int mcp4725_probe(struct i2c_client *client,
 		goto err_disable_vref_reg;
 	}
 	pd = (inbuf[0] >> 1) & 0x3;
-	data->powerdown = pd > 0 ? true : false;
 	data->powerdown_mode = pd ? pd - 1 : 2; /* largest resistor to gnd */
 	data->dac_value = (inbuf[1] << 4) | (inbuf[2] >> 4);
 	if (data->id == MCP4726)