Skip to content

Commit 98692f5

Browse files
Sai Prakash Ranjanarndb
authored andcommitted
drm/meson: Fix overflow implicit truncation warnings
Fix -Woverflow warnings for drm/meson driver which is a result of moving arm64 custom MMIO accessor macros to asm-generic function implementations giving a bonus type-checking now and uncovering these overflow warnings. drivers/gpu/drm/meson/meson_viu.c: In function ‘meson_viu_init’: drivers/gpu/drm/meson/meson_registers.h:1826:48: error: large integer implicitly truncated to unsigned type [-Werror=overflow] #define VIU_OSD_BLEND_REORDER(dest, src) ((src) << (dest * 4)) ^ drivers/gpu/drm/meson/meson_viu.c:472:18: note: in expansion of macro ‘VIU_OSD_BLEND_REORDER’ writel_relaxed(VIU_OSD_BLEND_REORDER(0, 1) | ^~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot <[email protected]> Signed-off-by: Sai Prakash Ranjan <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Neil Armstrong <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 4436859 commit 98692f5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/gpu/drm/meson/meson_viu.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -469,17 +469,17 @@ void meson_viu_init(struct meson_drm *priv)
469469
priv->io_base + _REG(VD2_IF0_LUMA_FIFO_SIZE));
470470

471471
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) {
472-
writel_relaxed(VIU_OSD_BLEND_REORDER(0, 1) |
473-
VIU_OSD_BLEND_REORDER(1, 0) |
474-
VIU_OSD_BLEND_REORDER(2, 0) |
475-
VIU_OSD_BLEND_REORDER(3, 0) |
476-
VIU_OSD_BLEND_DIN_EN(1) |
477-
VIU_OSD_BLEND1_DIN3_BYPASS_TO_DOUT1 |
478-
VIU_OSD_BLEND1_DOUT_BYPASS_TO_BLEND2 |
479-
VIU_OSD_BLEND_DIN0_BYPASS_TO_DOUT0 |
480-
VIU_OSD_BLEND_BLEN2_PREMULT_EN(1) |
481-
VIU_OSD_BLEND_HOLD_LINES(4),
482-
priv->io_base + _REG(VIU_OSD_BLEND_CTRL));
472+
u32 val = (u32)VIU_OSD_BLEND_REORDER(0, 1) |
473+
(u32)VIU_OSD_BLEND_REORDER(1, 0) |
474+
(u32)VIU_OSD_BLEND_REORDER(2, 0) |
475+
(u32)VIU_OSD_BLEND_REORDER(3, 0) |
476+
(u32)VIU_OSD_BLEND_DIN_EN(1) |
477+
(u32)VIU_OSD_BLEND1_DIN3_BYPASS_TO_DOUT1 |
478+
(u32)VIU_OSD_BLEND1_DOUT_BYPASS_TO_BLEND2 |
479+
(u32)VIU_OSD_BLEND_DIN0_BYPASS_TO_DOUT0 |
480+
(u32)VIU_OSD_BLEND_BLEN2_PREMULT_EN(1) |
481+
(u32)VIU_OSD_BLEND_HOLD_LINES(4);
482+
writel_relaxed(val, priv->io_base + _REG(VIU_OSD_BLEND_CTRL));
483483

484484
writel_relaxed(OSD_BLEND_PATH_SEL_ENABLE,
485485
priv->io_base + _REG(OSD1_BLEND_SRC_CTRL));

0 commit comments

Comments
 (0)