* [PATCH] iio: temperature: ltc2983: remove redundant comparison to bool
@ 2020-03-28 6:53 Rohit Sarkar
2020-03-28 9:43 ` Sa, Nuno
0 siblings, 1 reply; 3+ messages in thread
From: Rohit Sarkar @ 2020-03-28 6:53 UTC (permalink / raw)
To: linux-iio
Cc: Nuno Sá,
rohitsarkar5398, jic23, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, linux-kernel, dragos.bogdan
Remove redundant comparison to a boolean variable.
Fixes coccinelle warning:
drivers/iio/temperature//ltc2983.c:393:20-32: WARNING: Comparison to bool
drivers/iio/temperature//ltc2983.c:394:20-32: WARNING: Comparison to bool
Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
---
drivers/iio/temperature/ltc2983.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index d39c0d6b77f1..8976e8d59826 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -390,8 +390,8 @@ static struct ltc2983_custom_sensor *__ltc2983_custom_sensor_new(
* For custom steinhart, the full u32 is taken. For all the others
* the MSB is discarded.
*/
- const u8 n_size = (is_steinhart == true) ? 4 : 3;
- const u8 e_size = (is_steinhart == true) ? sizeof(u32) : sizeof(u64);
+ const u8 n_size = is_steinhart ? 4 : 3;
+ const u8 e_size = is_steinhart ? sizeof(u32) : sizeof(u64);
n_entries = of_property_count_elems_of_size(np, propname, e_size);
/* n_entries must be an even number */
--
2.23.0.385.gbc12974a89
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] iio: temperature: ltc2983: remove redundant comparison to bool
2020-03-28 6:53 [PATCH] iio: temperature: ltc2983: remove redundant comparison to bool Rohit Sarkar
@ 2020-03-28 9:43 ` Sa, Nuno
2020-03-28 17:54 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Sa, Nuno @ 2020-03-28 9:43 UTC (permalink / raw)
To: Rohit Sarkar, linux-iio
Cc: jic23, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-iio, linux-kernel, Bogdan, Dragos
> -----Original Message-----
> From: Rohit Sarkar <rohitsarkar5398@gmail.com>
> Sent: Samstag, 28. März 2020 07:53
> To: linux-iio@vger.kernel.org
> Cc: Sa, Nuno <Nuno.Sa@analog.com>; rohitsarkar5398@gmail.com;
> jic23@kernel.org; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen
> <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>; linux-
> iio@vger.kernel.org; linux-kernel@vger.kernel.org; Bogdan, Dragos
> <Dragos.Bogdan@analog.com>
> Subject: [PATCH] iio: temperature: ltc2983: remove redundant comparison to
> bool
>
>
> Remove redundant comparison to a boolean variable.
>
> Fixes coccinelle warning:
> drivers/iio/temperature//ltc2983.c:393:20-32: WARNING: Comparison to
> bool
> drivers/iio/temperature//ltc2983.c:394:20-32: WARNING: Comparison to
> bool
>
> Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
> ---
> drivers/iio/temperature/ltc2983.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/temperature/ltc2983.c
> b/drivers/iio/temperature/ltc2983.c
> index d39c0d6b77f1..8976e8d59826 100644
> --- a/drivers/iio/temperature/ltc2983.c
> +++ b/drivers/iio/temperature/ltc2983.c
> @@ -390,8 +390,8 @@ static struct ltc2983_custom_sensor
> *__ltc2983_custom_sensor_new(
> * For custom steinhart, the full u32 is taken. For all the others
> * the MSB is discarded.
> */
> - const u8 n_size = (is_steinhart == true) ? 4 : 3;
> - const u8 e_size = (is_steinhart == true) ? sizeof(u32) : sizeof(u64);
> + const u8 n_size = is_steinhart ? 4 : 3;
> + const u8 e_size = is_steinhart ? sizeof(u32) : sizeof(u64);
>
> n_entries = of_property_count_elems_of_size(np, propname, e_size);
> /* n_entries must be an even number */
> --
Acked-by: Nuno Sá <nuno.sa@analog.com>
Thanks,
Nuno Sá
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iio: temperature: ltc2983: remove redundant comparison to bool
2020-03-28 9:43 ` Sa, Nuno
@ 2020-03-28 17:54 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2020-03-28 17:54 UTC (permalink / raw)
To: Sa, Nuno
Cc: Rohit Sarkar, linux-iio, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, linux-kernel, Bogdan, Dragos
On Sat, 28 Mar 2020 09:43:58 +0000
"Sa, Nuno" <Nuno.Sa@analog.com> wrote:
> > -----Original Message-----
> > From: Rohit Sarkar <rohitsarkar5398@gmail.com>
> > Sent: Samstag, 28. März 2020 07:53
> > To: linux-iio@vger.kernel.org
> > Cc: Sa, Nuno <Nuno.Sa@analog.com>; rohitsarkar5398@gmail.com;
> > jic23@kernel.org; Hartmut Knaack <knaack.h@gmx.de>; Lars-Peter Clausen
> > <lars@metafoo.de>; Peter Meerwald-Stadler <pmeerw@pmeerw.net>; linux-
> > iio@vger.kernel.org; linux-kernel@vger.kernel.org; Bogdan, Dragos
> > <Dragos.Bogdan@analog.com>
> > Subject: [PATCH] iio: temperature: ltc2983: remove redundant comparison to
> > bool
> >
> >
> > Remove redundant comparison to a boolean variable.
> >
> > Fixes coccinelle warning:
> > drivers/iio/temperature//ltc2983.c:393:20-32: WARNING: Comparison to
> > bool
> > drivers/iio/temperature//ltc2983.c:394:20-32: WARNING: Comparison to
> > bool
> >
> > Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
> > ---
> > drivers/iio/temperature/ltc2983.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iio/temperature/ltc2983.c
> > b/drivers/iio/temperature/ltc2983.c
> > index d39c0d6b77f1..8976e8d59826 100644
> > --- a/drivers/iio/temperature/ltc2983.c
> > +++ b/drivers/iio/temperature/ltc2983.c
> > @@ -390,8 +390,8 @@ static struct ltc2983_custom_sensor
> > *__ltc2983_custom_sensor_new(
> > * For custom steinhart, the full u32 is taken. For all the others
> > * the MSB is discarded.
> > */
> > - const u8 n_size = (is_steinhart == true) ? 4 : 3;
> > - const u8 e_size = (is_steinhart == true) ? sizeof(u32) : sizeof(u64);
> > + const u8 n_size = is_steinhart ? 4 : 3;
> > + const u8 e_size = is_steinhart ? sizeof(u32) : sizeof(u64);
> >
> > n_entries = of_property_count_elems_of_size(np, propname, e_size);
> > /* n_entries must be an even number */
> > --
>
> Acked-by: Nuno Sá <nuno.sa@analog.com>
>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.
Thanks,
Jonathan
> Thanks,
> Nuno Sá
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-28 17:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28 6:53 [PATCH] iio: temperature: ltc2983: remove redundant comparison to bool Rohit Sarkar
2020-03-28 9:43 ` Sa, Nuno
2020-03-28 17:54 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).