iio: dac: mcp4725: Remove unneeded conversions to bool
PATCH 1/1 iio: dac: mcp4725: Remove unneeded conversions to bool
Found with scripts/coccinelle/misc/boolconv.cocci.
Signed-off-by Andrew F. Davis <[email protected]>
--- drivers/iio/dac/mcp4725.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/mcp4725.c +1 -1
@@ -476,7 +476,7 @@ 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 = pd >0 ; data->powerdown_mode = pd ? pd -1 :2 ;/* largest resistor to gnd */ data->dac_value = (inbuf[1 ] <<4 ) | (inbuf[2 ] >>4 );if (data->id ==MCP4726 )
Signature · 1 line
2.15.0
Jonathan Cameron
maintainerQuoted 3 lines · On Tue, 5 Dec 2017 13:12:01 -0600 "Andrew F. Davis" <[email protected]> wrote:
Found with
scripts/coccinelle/misc/boolconv.cocci.Signed-off-by Andrew F. Davis <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 17 lines
--- drivers/iio/dac/mcp4725.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/dac/mcp4725.c +1
-1@@ -476,7 +476,7 @@ 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 = pd >0 ; data->powerdown_mode = pd ? pd -1 :2 ;/* largest resistor to gnd */ data->dac_value = (inbuf[1 ] <<4 ) | (inbuf[2 ] >>4 );if (data->id ==MCP4726 )