1
0
Fork 0
alistair23-linux/include/media
Nathan Chancellor 6107a895e3 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-24 08:36:36 +01:00
..
davinci media: davinci/vpfe_capture.c: drop unused format descriptions 2019-07-25 06:30:00 -04:00
drv-intf media: media/platform: don't set description in ENUM_FMT 2019-07-22 14:43:59 -04:00
i2c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tpg media: include/(uapi/)media: add SPDX license info 2018-02-14 13:23:51 -05:00
cec-notifier.h media: cec-notifier: add new notifier functions 2019-06-27 07:19:43 -04:00
cec-pin.h media: cec: add support for 5V signal testing 2018-07-25 07:11:48 -04:00
cec.h media: cec: add struct cec_connector_info support 2019-06-27 07:18:43 -04:00
demux.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dmxdev.h media: dmxdev: Fix the logic that enables DMA mmap support 2018-02-23 05:27:10 -05:00
dvb-usb-ids.h media: dvbsky: add support for eyeTV Geniatech T2 lite 2020-02-01 09:34:47 +00:00
dvb_ca_en50221.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_demux.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dvb_frontend.h media: dvb_frontend.h: Fix shifting signed 32-bit value problem 2019-08-14 05:04:08 -03:00
dvb_math.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_net.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_ringbuffer.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
dvb_vb2.h media: dvb: update buffer mmaped flags and frame counter 2018-02-23 11:44:08 -05:00
dvbdev.h media: docs: fix minor typos 2019-06-05 11:31:51 -04:00
fwht-ctrls.h media: vicodec: Introducing stateless fwht defs and structs 2019-03-25 14:02:30 -04:00
h264-ctrls.h media: uapi: h264: Get rid of the p0/b0/b1 ref-lists 2019-08-19 13:24:04 -03:00
imx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
media-dev-allocator.h media: Media Device Allocator API 2019-04-22 11:18:26 -04:00
media-device.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
media-devnode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
media-entity.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
media-request.h media: media requests: return EBADR instead of EACCES 2019-03-25 13:26:10 -04:00
mpeg2-ctrls.h media: cedrus: identify buffers by timestamp 2019-01-07 13:20:54 -05:00
rc-core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
rc-map.h media: rc: add keymap for HardKernel ODROID remote 2019-08-21 18:39:54 -03:00
rcar-fcp.h media: rcar-fcp: convert to SPDX identifiers 2018-09-12 09:29:03 -04:00
soc_camera.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tuner-types.h media: tuner-types: add kernel-doc markups for struct tunertype 2017-12-18 09:06:40 -05:00
tuner.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
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 media: v4l2-async: Add v4l2_async_notifier_add_fwnode_remote_subdev 2019-07-25 08:03:03 -04:00
v4l2-clk.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
v4l2-common.h media: v4l2-core: introduce a helper to unregister a i2c subdev 2019-08-26 10:52:06 -03:00
v4l2-ctrls.h media: v4l: ctrls: Add debug messages 2019-07-25 06:26:49 -04:00
v4l2-dev.h media: v4l2-ioctl: add QUIRK_INVERTED_CROP 2018-11-20 13:28:20 -05:00
v4l2-device.h media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-24 08:36:36 +01:00
v4l2-dv-timings.h media: cec/v4l2: move V4L2 specific CEC functions to V4L2 2018-09-24 09:11:04 -04:00
v4l2-event.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
v4l2-fh.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
v4l2-flash-led-class.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
v4l2-fwnode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206 2019-05-30 11:29:53 -07:00
v4l2-image-sizes.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
v4l2-ioctl.h media: v4l: ctrls: Add debug messages 2019-07-25 06:26:49 -04:00
v4l2-mc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
v4l2-mediabus.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
v4l2-mem2mem.h Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
v4l2-rect.h media: v4l2-rect.h: fix v4l2_rect_map_inside() top/left adjustments 2020-02-11 04:35:14 -08:00
v4l2-subdev.h media: v4l2-subdev: Verify arguments in v4l2_subdev_call() 2019-06-24 14:53:44 -04:00
videobuf-core.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 237 2019-06-19 17:09:07 +02:00
videobuf-dma-contig.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 237 2019-06-19 17:09:07 +02:00
videobuf-dma-sg.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 237 2019-06-19 17:09:07 +02:00
videobuf-vmalloc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 237 2019-06-19 17:09:07 +02:00
videobuf2-core.h media: vb2: Introduce a vb2_get_buffer accessor 2019-06-21 16:20:23 -04:00
videobuf2-dma-contig.h dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
videobuf2-dma-sg.h media: Change Andrzej Pietrasiewicz's e-mail address 2019-01-16 11:21:07 -05:00
videobuf2-dvb.h media: move dvb kAPI headers to include/media 2017-12-28 13:16:01 -05:00
videobuf2-memops.h media: videobuf2-vmalloc: get_userptr: buffers are always writable 2019-05-29 08:05:58 -04:00
videobuf2-v4l2.h media: vb2: vb2_find_timestamp: drop restriction on buffer state 2019-01-31 09:26:55 -02:00
videobuf2-vmalloc.h [media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2 2015-10-01 08:48:18 -03:00
vp8-ctrls.h media: uapi: new file needs types.h 2019-07-23 08:19:32 -04:00
vsp1.h media: vsp1: drm: Implement writeback support 2019-03-18 17:24:14 +02:00