staging: media: Remove ternary operator
authorGargi Sharma <gs051095@gmail.com>
Sun, 19 Feb 2017 19:14:18 +0000 (00:44 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Mar 2017 08:17:02 +0000 (09:17 +0100)
Relational and logical operators evaluate to either true or false.
Explicit conversion is not needed so remove the ternary operator.
Done using coccinelle:

@r@
expression A,B;
symbol true,false;
binary operator b = {==,!=,&&,||,>=,<=,>,<};
@@
- (A b B) ? true : false
+ A b B

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/platform/bcm2835/controls.c

index a40987b2e75d2f1faf557ad67ac0b024013bbd45..4d7e2a2976c29a86942d0c51c195ea46d325b155 100644 (file)
@@ -218,9 +218,7 @@ static int ctrl_set_iso(struct bm2835_mmal_dev *dev,
                dev->iso = iso_values[ctrl->val];
        else if (ctrl->id == V4L2_CID_ISO_SENSITIVITY_AUTO)
                dev->manual_iso_enabled =
-                               (ctrl->val == V4L2_ISO_SENSITIVITY_MANUAL ?
-                                                       true :
-                                                       false);
+                               (ctrl->val == V4L2_ISO_SENSITIVITY_MANUAL);
 
        control = &dev->component[MMAL_COMPONENT_CAMERA]->control;