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

drivers/media/i2c/s5k5baf.c: In function 's5k5baf_set_power':
drivers/media/i2c/s5k5baf.c:1057:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  if (!on != state->power)
          ^
drivers/media/i2c/s5k6aa.c: In function 's5k6aa_set_power':
drivers/media/i2c/s5k6aa.c:878:10: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  if (!on == s5k6aa->power) {
          ^
drivers/media/i2c/s5c73m3/s5c73m3-core.c: In function 's5c73m3_oif_set_power':
drivers/media/i2c/s5c73m3/s5c73m3-core.c:1456:17: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
  } else if (!on == state->power) {
                 ^

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/i2c/s5c73m3/s5c73m3-core.c
drivers/media/i2c/s5k5baf.c
drivers/media/i2c/s5k6aa.c

index 08b234bd2962cdcfe7674b05ded5fb0fb65b096b..53c5ea89f0b9768c9b6c64ae4e9bcf5a512fa7ef 100644 (file)
@@ -1453,7 +1453,7 @@ static int s5c73m3_oif_set_power(struct v4l2_subdev *sd, int on)
                        state->apply_fiv = 1;
                        state->apply_fmt = 1;
                }
-       } else if (!on == state->power) {
+       } else if (state->power == !on) {
                ret = s5c73m3_set_af_softlanding(state);
                if (!ret)
                        ret = __s5c73m3_power_off(state);
index 297ef04e146a390da983d17996d62de587cf9b71..bee73de347dc24a990c3323b11170c246dae5d8a 100644 (file)
@@ -1054,7 +1054,7 @@ static int s5k5baf_set_power(struct v4l2_subdev *sd, int on)
 
        mutex_lock(&state->lock);
 
-       if (!on != state->power)
+       if (state->power != !on)
                goto out;
 
        if (on) {
index de803a11efb41419f96841266bce1de37f56010f..d0ad6a25bdabf2e602bdf4b8dd9ab7db384a4f4a 100644 (file)
@@ -875,7 +875,7 @@ static int s5k6aa_set_power(struct v4l2_subdev *sd, int on)
 
        mutex_lock(&s5k6aa->lock);
 
-       if (!on == s5k6aa->power) {
+       if (s5k6aa->power == !on) {
                if (on) {
                        ret = __s5k6aa_power_on(s5k6aa);
                        if (!ret)