Skip to contentSkip to conversation

Drivers:iio:dac: Remove unneeded conversion to bool

PATCH Superseded [email protected] 2 participants 2 messages Jan 4, 2018 IIO

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

---
 drivers/iio/dac/mcp4725.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/dac/mcp4725.c +0 -1
index afa856d..8f8c529 100644
@@ -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
#1 lore raw
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.c file which
fixes the following coccinelle warning:

WARNING: conversion to bool not needed here

---
 drivers/iio/dac/mcp4725.c | 1 -
 1 file changed, 1 deletion(-)
drivers/iio/dac/mcp4725.c +0 -0
index afa856d..8f8c529 100644

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