From: Hans Verkuil <hans.verk...@cisco.com>

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.verk...@cisco.com>
Cc: Kamil Debski <k.deb...@samsung.com>
---
 drivers/media/platform/s3c-camif/camif-capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/s3c-camif/camif-capture.c 
b/drivers/media/platform/s3c-camif/camif-capture.c
index f6a61b9..db4d7d2 100644
--- a/drivers/media/platform/s3c-camif/camif-capture.c
+++ b/drivers/media/platform/s3c-camif/camif-capture.c
@@ -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;
-- 
2.1.4

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

Reply via email to