linux-stable/include/media
Nathan Chancellor cf47143876 media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros
[ Upstream commit afb3478162 ]

When building with Clang + -Wtautological-constant-compare, several of
the ivtv and cx18 drivers warn along the lines of:

 drivers/media/pci/cx18/cx18-driver.c:1005:21: warning: converting the
 result of '<<' to a boolean always evaluates to true
 [-Wtautological-constant-compare]
                         cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
                                         ^
 drivers/media/pci/cx18/cx18-cards.h:18:37: note: expanded from macro
 'CX18_HW_GPIO_RESET_CTRL'
 #define CX18_HW_GPIO_RESET_CTRL         (1 << 6)
                                           ^
 1 warning generated.

This warning happens because the shift operation is implicitly converted
to a boolean in v4l2_device_mask_call_all before being negated. This can
be solved by just comparing the mask result to 0 explicitly so that
there is no boolean conversion. The ultimate goal is to enable
-Wtautological-compare globally because there are several subwarnings
that would be helpful to have.

For visual consistency and avoidance of these warnings in the future,
all of the implicitly boolean conversions in the v4l2_device macros
are converted to explicit ones as well.

Link: https://github.com/ClangBuiltLinux/linux/issues/752

Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-28 16:36:00 +01:00
..
blackfin License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
davinci media: davinci/vpbe: array underflow in vpbe_enum_outputs() 2020-01-27 14:46:33 +01:00
drv-intf License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
i2c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cec-notifier.h
cec-pin.h
cec.h media: cec: make cec_get_edid_spa_location() an inline function 2019-05-16 19:42:26 +02:00
i2c-addr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
imx.h
lirc.h
lirc_dev.h
media-device.h
media-devnode.h
media-entity.h
rc-core.h
rc-map.h
rcar-fcp.h
soc_camera.h
tuner-types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tuner.h
tveeprom.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v4l2-async.h
v4l2-clk.h
v4l2-common.h
v4l2-ctrls.h
v4l2-dev.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v4l2-device.h media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-28 16:36:00 +01:00
v4l2-dv-timings.h
v4l2-event.h
v4l2-fh.h media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-03 17:01:00 -07:00
v4l2-flash-led-class.h
v4l2-fwnode.h
v4l2-image-sizes.h
v4l2-ioctl.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v4l2-mc.h
v4l2-mediabus.h
v4l2-mem2mem.h
v4l2-rect.h media: v4l2-rect.h: fix v4l2_rect_map_inside() top/left adjustments 2020-02-14 16:32:08 -05:00
v4l2-subdev.h
v4l2-tpg-colors.h
v4l2-tpg.h
videobuf-core.h
videobuf-dma-contig.h
videobuf-dma-sg.h
videobuf-dvb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
videobuf-vmalloc.h
videobuf2-core.h
videobuf2-dma-contig.h
videobuf2-dma-sg.h
videobuf2-dvb.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
videobuf2-memops.h
videobuf2-v4l2.h
videobuf2-vmalloc.h
vsp1.h