* [PATCH V3] Drivers:iio:dac: Remove unneeded conversion to bool
@ 2018-01-06 14:53 venkat.prashanth2498
2018-01-06 15:08 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: venkat.prashanth2498 @ 2018-01-06 14:53 UTC (permalink / raw)
To: lars, Michael.Hennerich, jic23
Cc: knaack.h, pmeerw, linux-iio, Venkat Prashanth B U
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>
---
change log v2:-
Fixed version log issue.
change log v1:-
Instead of inadvertent removal of complete statement, only the
conversion to bool is removed.
---
drivers/iio/dac/mcp4725.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index afa856d..8b5aad4 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -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)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V3] Drivers:iio:dac: Remove unneeded conversion to bool
2018-01-06 14:53 [PATCH V3] Drivers:iio:dac: Remove unneeded conversion to bool venkat.prashanth2498
@ 2018-01-06 15:08 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-01-06 15:08 UTC (permalink / raw)
To: venkat.prashanth2498; +Cc: lars, Michael.Hennerich, knaack.h, pmeerw, linux-iio
On Sat, 6 Jan 2018 20:23:29 +0530
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>
Much better.
I'm afraid what I missed previously is that Andrew Davis actually
fixed this back in December. It won't be visible yet in the
staging tree but is in the iio tree testing branch.
Sorry about that, I didn't realise until I discovered the patch
wouldn't apply.
Jonathan
> ---
> change log v2:-
> Fixed version log issue.
>
> change log v1:-
> Instead of inadvertent removal of complete statement, only the
> conversion to bool is removed.
> ---
> drivers/iio/dac/mcp4725.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
> index afa856d..8b5aad4 100644
> --- a/drivers/iio/dac/mcp4725.c
> +++ b/drivers/iio/dac/mcp4725.c
> @@ -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)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-06 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-06 14:53 [PATCH V3] Drivers:iio:dac: Remove unneeded conversion to bool venkat.prashanth2498
2018-01-06 15:08 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.