diff mbox

[28/46,media] lm3560: simplify boolean tests

Message ID 4e97984ba765f3811f32615b388e698e699b34af.1409775488.git.m.chehab@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mauro Carvalho Chehab Sept. 3, 2014, 8:33 p.m. UTC
Instead of using if (on == true), just use
if (on).

That allows a faster mental parsing when analyzing the
code.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

Comments

Sakari Ailus Sept. 4, 2014, 7:08 a.m. UTC | #1
On Wed, Sep 03, 2014 at 05:33:00PM -0300, Mauro Carvalho Chehab wrote:
> Instead of using if (on == true), just use
> if (on).
> 
> That allows a faster mental parsing when analyzing the
> code.
> 
> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Daniel Jeong Sept. 5, 2014, 5:30 a.m. UTC | #2
Hi.

> On Wed, Sep 03, 2014 at 05:33:00PM -0300, Mauro Carvalho Chehab wrote:
>> Instead of using if (on == true), just use
>> if (on).
>>
>> That allows a faster mental parsing when analyzing the
>> code.
>>
>> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>
I will keep it in my mind for my next patch files.

Thank you.

Acked-by: Daniel Jeong <gshark.jeong@gmail.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/i2c/lm3560.c b/drivers/media/i2c/lm3560.c
index c23de593c17d..d9ece4b2d047 100644
--- a/drivers/media/i2c/lm3560.c
+++ b/drivers/media/i2c/lm3560.c
@@ -100,14 +100,14 @@  static int lm3560_enable_ctrl(struct lm3560_flash *flash,
 	int rval;
 
 	if (led_no == LM3560_LED0) {
-		if (on == true)
+		if (on)
 			rval = regmap_update_bits(flash->regmap,
 						  REG_ENABLE, 0x08, 0x08);
 		else
 			rval = regmap_update_bits(flash->regmap,
 						  REG_ENABLE, 0x08, 0x00);
 	} else {
-		if (on == true)
+		if (on)
 			rval = regmap_update_bits(flash->regmap,
 						  REG_ENABLE, 0x10, 0x10);
 		else