Drivers:iio:dac: Remove unneeded conversion to bool
PATCH 1/1 Drivers:iio:dac: Remove unneeded conversion to bool
From: Venkat Prashanth B U <[email protected]>
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 <[email protected]>
--- drivers/iio/dac/mcp4725.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/dac/mcp4725.c +0 -1
@@ -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 )
Signature · 1 line
1.9.1
Quoted 17 lines · On 01/04/2018 12:58 PM, [email protected] wrote:
From: Venkat Prashanth B U <[email protected]>
This is a patch to the
mcp4725.cfile which
fixes the following coccinelle warning:WARNING: conversion to bool not needed here
Signed-off-by Venkat Prashanth B U <[email protected]>--- drivers/iio/dac/mcp4725.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/dac/mcp4725.c +0
-0
drivers/iio/dac/mcp4725.c static int mcp4725_probe(struct i2c_client *client, · line 479
Quoted 4 lines
drivers/iio/dac/mcp4725.c +0
-1@@ -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.
Quoted 4 lines
drivers/iio/dac/mcp4725.c +0
-0data->powerdown_mode = pd ? pd -1 :2 ;/* largest resistor to gnd */ data->dac_value = (inbuf[1 ] <<4 ) | (inbuf[2 ] >>4 );if (data->id ==MCP4726 )