Re: [PATCH v7 3/4] drm/loongson: Add interrupt driver for LS7A.

From: kernel test robot
Date: Mon Jul 11 2022 - 16:32:13 EST

Hi Chenyang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v5.19-rc6 next-20220708]
[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]

base: git:// drm-misc-next
config: arm64-allmodconfig (
compiler: clang version 15.0.0 ( 77a38f6839980bfac61babb40d83772c51427011)
reproduce (this is a W=1 build):
wget -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add linux-review
git fetch --no-tags linux-review Chenyang-Li/drm-loongson-Add-DRM-Driver-for-Loongson-7A1000-bridge-chip/20220625-171037
git checkout 7cad653ee3a3b83188e2d91335269753e134b808
# 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=arm64 SHELL=/bin/bash drivers/gpu/drm/loongson/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/loongson/loongson_irq.c:24:11: warning: variable 'lcrtc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
else if (val & FB_VSYNC1_INT)
drivers/gpu/drm/loongson/loongson_irq.c:27:26: note: uninitialized use occurs here
drivers/gpu/drm/loongson/loongson_irq.c:24:7: note: remove the 'if' if its condition is always true
else if (val & FB_VSYNC1_INT)
drivers/gpu/drm/loongson/loongson_irq.c:16:29: note: initialize the variable 'lcrtc' to silence this warning
struct loongson_crtc *lcrtc;
1 warning generated.

vim +24 drivers/gpu/drm/loongson/loongson_irq.c

12 static irqreturn_t loongson_irq_handler(int irq, void *arg)
13 {
14 struct drm_device *dev = (struct drm_device *) arg;
15 struct loongson_device *ldev = to_loongson_device(dev);
16 struct loongson_crtc *lcrtc;
17 u32 val;
19 val = ls7a_mm_rreg(ldev, FB_INT_REG);
20 ls7a_mm_wreg(ldev, FB_INT_REG, val & (0xffff << 16));
22 if (val & FB_VSYNC0_INT)
23 lcrtc = ldev->mode_info[0].crtc;
> 24 else if (val & FB_VSYNC1_INT)
25 lcrtc = ldev->mode_info[1].crtc;
27 drm_crtc_handle_vblank(&lcrtc->base);
29 return IRQ_HANDLED;
30 }

0-DAY CI Kernel Test Service