[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202208281910.qUZY1Xem-lkp@intel.com>
Date: Sun, 28 Aug 2022 19:51:11 +0800
From: kernel test robot <lkp@...el.com>
To: Lucas Stach <l.stach@...gutronix.de>
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-kernel@...r.kernel.org
Subject: [lst:imx8mp-hdmi 5/11]
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:76:11: warning: variable
'bus_flags' is used uninitialized whenever 'if' condition is false
tree: https://git.pengutronix.de/git/lst/linux imx8mp-hdmi
head: 7e80a6e2d0a4709e471ab951a64d323534a6776f
commit: b3d9e9dfedb64ed82e797a87259e6f7598f5b4d5 [5/11] drm/imx: add driver for HDMI TX Parallel Video Interface
config: riscv-randconfig-c006-20220828 (https://download.01.org/0day-ci/archive/20220828/202208281910.qUZY1Xem-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project a2100daf12fb980a29fd1a9c85ccf8eaaaf79730)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv-linux-gnu
git remote add lst https://git.pengutronix.de/git/lst/linux
git fetch --no-tags lst imx8mp-hdmi
git checkout b3d9e9dfedb64ed82e797a87259e6f7598f5b4d5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/drm/bridge/imx/ drivers/gpu/drm/rcar-du/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:76:11: warning: variable 'bus_flags' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (bridge_state)
^~~~~~~~~~~~
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:79:6: note: uninitialized use occurs here
if (bus_flags & DRM_BUS_FLAG_DE_HIGH)
^~~~~~~~~
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:76:7: note: remove the 'if' if its condition is always true
else if (bridge_state)
^~~~~~~~~~~~~~~~~
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c:55:15: note: initialize the variable 'bus_flags' to silence this warning
u32 bus_flags, val;
^
= 0
1 warning generated.
vim +76 drivers/gpu/drm/bridge/imx/imx8mp-hdmi-pvi.c
45
46 static void imx_hdmi_pvi_bridge_enable(struct drm_bridge *bridge,
47 struct drm_bridge_state *bridge_state)
48 {
49 struct drm_atomic_state *state = bridge_state->base.state;
50 struct imx_hdmi_pvi *pvi = to_imx_hdmi_pvi(bridge);
51 struct drm_connector_state *conn_state;
52 const struct drm_display_mode *mode;
53 struct drm_crtc_state *crtc_state;
54 struct drm_connector *connector;
55 u32 bus_flags, val;
56
57 connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
58 conn_state = drm_atomic_get_new_connector_state(state, connector);
59 crtc_state = drm_atomic_get_new_crtc_state(state, conn_state->crtc);
60
61 if (WARN_ON(pm_runtime_resume_and_get(pvi->dev)))
62 return;
63
64 mode = &crtc_state->adjusted_mode;
65
66 val = PVI_CTL_INPUT_LCDIF;
67
68 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
69 val |= PVI_CTL_OP_VSYNC_POL | PVI_CTL_INP_VSYNC_POL;
70
71 if (mode->flags & DRM_MODE_FLAG_PHSYNC)
72 val |= PVI_CTL_OP_HSYNC_POL | PVI_CTL_INP_HSYNC_POL;
73
74 if (pvi->next_bridge->timings)
75 bus_flags = pvi->next_bridge->timings->input_bus_flags;
> 76 else if (bridge_state)
77 bus_flags = bridge_state->input_bus_cfg.flags;
78
79 if (bus_flags & DRM_BUS_FLAG_DE_HIGH)
80 val |= PVI_CTL_OP_DE_POL | PVI_CTL_INP_DE_POL;
81
82 writel(val, pvi->regs + HTX_PVI_CTL);
83 val |= PVI_CTL_EN;
84 writel(val, pvi->regs + HTX_PVI_CTL);
85 }
86
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists