[media] s3c-camif: fix compiler warnings
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 27 Apr 2015 07:29:52 +0000 (04:29 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 28 Apr 2015 12:25:12 +0000 (09:25 -0300)
Fix these compiler warnings that appeared after switching to gcc-5.1.0:

drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_power':
drivers/media/platform/s3c-camif/camif-capture.c:118:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  if (!on == camif->sensor.power_count)
          ^
drivers/media/platform/s3c-camif/camif-capture.c: In function 'sensor_set_streaming':
drivers/media/platform/s3c-camif/camif-capture.c:134:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  if (!on == camif->sensor.stream_count)
          ^

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/s3c-camif/camif-capture.c

index f6a61b9..db4d7d2 100644 (file)
@@ -115,7 +115,7 @@ static int sensor_set_power(struct camif_dev *camif, int on)
        struct cam_sensor *sensor = &camif->sensor;
        int err = 0;
 
-       if (!on == camif->sensor.power_count)
+       if (camif->sensor.power_count == !on)
                err = v4l2_subdev_call(sensor->sd, core, s_power, on);
        if (!err)
                sensor->power_count += on ? 1 : -1;
@@ -131,7 +131,7 @@ static int sensor_set_streaming(struct camif_dev *camif, int on)
        struct cam_sensor *sensor = &camif->sensor;
        int err = 0;
 
-       if (!on == camif->sensor.stream_count)
+       if (camif->sensor.stream_count == !on)
                err = v4l2_subdev_call(sensor->sd, video, s_stream, on);
        if (!err)
                sensor->stream_count += on ? 1 : -1;