OSDN Git Service

media: use the BIT() macro
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 22 Aug 2019 14:06:32 +0000 (11:06 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 26 Aug 2019 17:08:50 +0000 (14:08 -0300)
commitcce8ccca80d8388982133192d0a6d9dc2e8ed712
tree4e37956f86eba2c619fe2a4d56af0b5c993411ae
parent093347abc7a4e0490e3c962ecbde2dc272a8f708
media: use the BIT() macro

As warned by cppcheck:

[drivers/media/dvb-frontends/cx24123.c:434]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[drivers/media/pci/bt8xx/bttv-input.c:87]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
[drivers/media/pci/bt8xx/bttv-input.c:98]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
...
[drivers/media/v4l2-core/v4l2-ioctl.c:1391]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour

There are lots of places where we're doing 1 << 31. That's bad,
as, depending on the architecture, this has an undefined behavior.

The BIT() macro is already prepared to handle this, so, let's
just switch all "1 << number" macros by BIT(number) at the header files
with has 1 << 31.

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> # exynos4-is and s3c-camif
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # omap3isp, vsp1, xilinx, wl128x and ipu3
Reviewed-by: Benoit Parrot <bparrot@ti.com> # am437x and ti-vpe
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
16 files changed:
drivers/media/pci/cobalt/cobalt-driver.h
drivers/media/pci/ivtv/ivtv-irq.h
drivers/media/pci/mantis/mantis_reg.h
drivers/media/pci/solo6x10/solo6x10-regs.h
drivers/media/platform/am437x/am437x-vpfe_regs.h
drivers/media/platform/davinci/dm644x_ccdc_regs.h
drivers/media/platform/exynos4-is/fimc-lite-reg.h
drivers/media/platform/exynos4-is/fimc-reg.h
drivers/media/platform/omap3isp/ispreg.h
drivers/media/platform/s3c-camif/camif-regs.h
drivers/media/platform/tegra-cec/tegra_cec.h
drivers/media/platform/ti-vpe/vpe_regs.h
drivers/media/platform/vsp1/vsp1_regs.h
drivers/media/platform/xilinx/xilinx-vip.h
drivers/media/radio/wl128x/fmdrv_common.h
drivers/staging/media/ipu3/ipu3-tables.h