OSDN Git Service

iio: dac: mcp4725: Remove unneeded conversions to bool
authorAndrew F. Davis <afd@ti.com>
Tue, 5 Dec 2017 19:12:01 +0000 (13:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:41 +0000 (16:03 +0100)
Found with scripts/coccinelle/misc/boolconv.cocci.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/dac/mcp4725.c

index afa856d..8b5aad4 100644 (file)
@@ -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)