From: Andrzej Hajda Date: Thu, 5 Jan 2017 12:34:07 +0000 (-0200) Subject: [media] v4l: s5c73m3: fix negation operator X-Git-Tag: v4.11-rc1~132^2~142 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a2370ba2752538404e363346b339869c9973aeac;p=karo-tx-linux.git [media] v4l: s5c73m3: fix negation operator Bool values should be negated using logical operators. Using bitwise operators results in unexpected and possibly incorrect results. Reported-by: David Binderman Signed-off-by: Andrzej Hajda Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c index 0a060339e516..2e7185030741 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-ctrls.c @@ -211,7 +211,7 @@ static int s5c73m3_3a_lock(struct s5c73m3 *state, struct v4l2_ctrl *ctrl) } if ((ctrl->val ^ ctrl->cur.val) & V4L2_LOCK_FOCUS) - ret = s5c73m3_af_run(state, ~af_lock); + ret = s5c73m3_af_run(state, !af_lock); return ret; }