media: i2c: adv748x: Fix unsafe macros
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 22 Oct 2019 13:25:22 +0000 (15:25 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 13 Dec 2019 08:14:27 +0000 (09:14 +0100)
commit0d962e061abcf1b9105f88fb850158b5887fbca3
treeb48f377abac602b48a27a472f354251e5156e170
parentc4e8f760581b8607a1989acb8925be25d6628760
media: i2c: adv748x: Fix unsafe macros

Enclose multiple macro parameters in parentheses in order to
make such macros safer and fix the Clang warning below:

drivers/media/i2c/adv748x/adv748x-afe.c:452:12: warning: operator '?:'
has lower precedence than '|'; '|' will be evaluated first
[-Wbitwise-conditional-parentheses]

ret = sdp_clrset(state, ADV748X_SDP_FRP, ADV748X_SDP_FRP_MASK, enable
? ctrl->val - 1 : 0);

Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/adv748x/adv748x.h