Skip to contentSkip to conversation

iio: temperature: ltc2983: remove redundant comparison to bool

PATCH In review Rohit Sarkar 3 participants 3 messages Mar 28, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 drivers/iio/temperature/ltc2983.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +2 -2
index d39c0d6b77f1..8976e8d59826 100644
@@ -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 */
Signature · 1 line
2.23.0.385.gbc12974a89
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 44 lines

-----Original Message-----
From: Rohit Sarkar <[email protected]>
Sent: Samstag, 28. März 2020 07:53
To: [email protected]
Cc: Sa, Nuno <[email protected]>; [email protected]; [email protected]; Hartmut Knaack <[email protected]>; Lars-Peter Clausen <[email protected]>; Peter Meerwald-Stadler <[email protected]>; linux- [email protected]; [email protected]; Bogdan, Dragos <[email protected]>
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

---
 drivers/iio/temperature/ltc2983.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +2 -2
index d39c0d6b77f1..8976e8d59826 100644
@@ -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);
Quoted 2 lines

/* n_entries must be an even number */
--

Thanks,
Nuno Sá

maintainer
#2 lore raw
Quoted 41 lines · Nuno
Quoted 41 lines

-----Original Message-----
From: Rohit Sarkar <[email protected]>
Sent: Samstag, 28. März 2020 07:53
To: [email protected]
Cc: Sa, Nuno <[email protected]>; [email protected]; [email protected]; Hartmut Knaack <[email protected]>; Lars-Peter Clausen <[email protected]>; Peter Meerwald-Stadler <[email protected]>; linux- [email protected]; [email protected]; Bogdan, Dragos <[email protected]>
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

---
 drivers/iio/temperature/ltc2983.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iio/temperature/ltc2983.c +2 -2
index d39c0d6b77f1..8976e8d59826 100644
@@ -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);
 
Quoted 6 lines
Quoted 3 lines
drivers/iio/temperature/ltc2983.c +0 -0
 	n_entries = of_property_count_elems_of_size(np, propname, e_size);

/* n_entries must be an even number */

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 3 lines

Thanks,
Nuno Sá