Re: [PATCH v2 23/39] drm/bridge: nxp-ptn3460: switch to ->edid_read callback

kernel test robot
2024-01-03T20:21:54Z

Hi Jani,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on drm/drm-next drm-exynos/exynos-drm-next drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.7-rc8 next-20240103]
[cannot apply to drm-intel/for-linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jani-Nikula/drm-bridge-add-edid_read-hook-and-drm_bridge_edid_read/20240103-181513
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/87fb7fd52d087dd9a15b7194f3915b6b1c4146d6.1704276309.git.jani.nikula%40intel.com
patch subject: [PATCH v2 23/39] drm/bridge: nxp-ptn3460: switch to ->edid_read callback
config: arm-randconfig-001-20240103 (https://download.01.org/0day-ci/archive/20240104/202401040455.PPhqJiVr-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 7e186d366d6c7def0543acc255931f617e76dff0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240104/202401040455.PPhqJiVr-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401040455.PPhqJiVr-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/bridge/nxp-ptn3460.c:170:6: warning: variable 'drm_edid' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
170 | if (!edid) {
| ^~~~~
drivers/gpu/drm/bridge/nxp-ptn3460.c:189:9: note: uninitialized use occurs here
189 | return drm_edid;
| ^~~~~~~~
drivers/gpu/drm/bridge/nxp-ptn3460.c:170:2: note: remove the 'if' if its condition is always false
170 | if (!edid) {
| ^~~~~~~~~~~~
171 | DRM_ERROR("Failed to allocate EDID\n");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172 | goto out;
| ~~~~~~~~~
173 | }
| ~
drivers/gpu/drm/bridge/nxp-ptn3460.c:161:33: note: initialize the variable 'drm_edid' to silence this warning
161 | const struct drm_edid *drm_edid;
| ^
| = NULL
1 warning generated.

vim +170 drivers/gpu/drm/bridge/nxp-ptn3460.c

a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 155
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 156
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 157 static const struct drm_edid *ptn3460_edid_read(struct drm_bridge *bridge,
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 158 struct drm_connector *connector)
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 159 {
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 160 struct ptn3460_bridge *ptn_bridge = bridge_to_ptn3460(bridge);
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 161 const struct drm_edid *drm_edid;
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 162 bool power_off;
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 163 u8 *edid;
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 164 int ret;
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 165
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 166 power_off = !ptn_bridge->enabled;
94d50d57c4403a drivers/gpu/drm/bridge/ptn3460.c Ajay Kumar 2015-01-20 167 ptn3460_pre_enable(&ptn_bridge->bridge);
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 168
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 169 edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 @170 if (!edid) {
94d50d57c4403a drivers/gpu/drm/bridge/ptn3460.c Ajay Kumar 2015-01-20 171 DRM_ERROR("Failed to allocate EDID\n");
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 172 goto out;
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 173 }
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 174
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 175 ret = ptn3460_read_bytes(ptn_bridge, PTN3460_EDID_ADDR, edid,
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 176 EDID_LENGTH);
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 177 if (ret) {
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 178 kfree(edid);
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 179 drm_edid = NULL;
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 180 goto out;
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 181 }
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 182
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 183 drm_edid = drm_edid_alloc(edid, EDID_LENGTH);
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 184
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 185 out:
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 186 if (power_off)
94d50d57c4403a drivers/gpu/drm/bridge/ptn3460.c Ajay Kumar 2015-01-20 187 ptn3460_disable(&ptn_bridge->bridge);
a9fe713d7d45c6 drivers/gpu/drm/bridge/ptn3460.c Sean Paul 2014-02-24 188
dd6c2ed9dace84 drivers/gpu/drm/bridge/nxp-ptn3460.c Jani Nikula 2024-01-03 189 return drm_edid;
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 190 }
4151c14cdda689 drivers/gpu/drm/bridge/nxp-ptn3460.c Sam Ravnborg 2020-07-27 191

--
0-DAY CI Kernel Test Service