Skip to contentSkip to conversation

media: i2c: Simplify bool conversion

PATCH New Yang Li 1 participant 1 message Dec 2, 2021

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 media: i2c: Simplify bool conversion

Fix the following coccicheck warning:
./drivers/media/i2c/ov5693.c:989:46-51: WARNING: conversion to bool not needed here
./drivers/media/i2c/ov5693.c:991:46-51: WARNING: conversion to bool not needed here

---
 drivers/media/i2c/ov5693.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5693.c +2 -2
index 2784fcf..4a5aa6e0 100644
@@ -986,9 +986,9 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
 
 	mutex_lock(&ov5693->lock);
 
-	ov5693->mode.binning_x = hratio > 1 ? true : false;
+	ov5693->mode.binning_x = hratio > 1;
 	ov5693->mode.inc_x_odd = hratio > 1 ? 3 : 1;
-	ov5693->mode.binning_y = vratio > 1 ? true : false;
+	ov5693->mode.binning_y = vratio > 1;
 	ov5693->mode.inc_y_odd = vratio > 1 ? 3 : 1;
 
 	ov5693->mode.vts = __ov5693_calc_vts(fmt->height);
Signature · 1 line
1.8.3.1