[xilinx-xlnx:xlnx_rebase_v5.15_LTS_2022.1_update 643/1093] drivers/gpu/drm/xlnx/xlnx_scaler.c:866:3: warning: variable 'nr_rds' is uninitialized when used here
kernel test robot
lkp at intel.com
Tue May 17 17:01:16 PDT 2022
Hi Venkateshwar,
FYI, the error/warning still remains.
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
head: 5ead03b6e64b5072737c653bb20ebcd88704e3d1
commit: 3a0ea0feebe5cb529d57e0f9673d22e4754c6415 [643/1093] drm: xlnx: scaler: Adding vpss-scaler driver
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20220518/202205180743.hhbiacb2-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 853fa8ee225edf2d0de94b0dcbd31bea916e825e)
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
# https://github.com/Xilinx/linux-xlnx/commit/3a0ea0feebe5cb529d57e0f9673d22e4754c6415
git remote add xilinx-xlnx https://github.com/Xilinx/linux-xlnx
git fetch --no-tags xilinx-xlnx xlnx_rebase_v5.15_LTS_2022.1_update
git checkout 3a0ea0feebe5cb529d57e0f9673d22e4754c6415
# 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=i386 SHELL=/bin/bash drivers/gpu/drm/xlnx/ drivers/media/i2c/ drivers/media/platform/xilinx/ drivers/net/ethernet/xilinx/ drivers/phy/xilinx/ drivers/staging/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/xlnx/xlnx_scaler.c:866:3: warning: variable 'nr_rds' is uninitialized when used here [-Wuninitialized]
nr_rds += nr_rds_clck;
^~~~~~
drivers/gpu/drm/xlnx/xlnx_scaler.c:821:12: note: initialize the variable 'nr_rds' to silence this warning
int nr_rds;
^
= 0
drivers/gpu/drm/xlnx/xlnx_scaler.c:1394:14: warning: variable 'fmt_out' set but not used [-Wunused-but-set-variable]
u32 fmt_in, fmt_out;
^
drivers/gpu/drm/xlnx/xlnx_scaler.c:1394:6: warning: variable 'fmt_in' set but not used [-Wunused-but-set-variable]
u32 fmt_in, fmt_out;
^
3 warnings generated.
vim +/nr_rds +866 drivers/gpu/drm/xlnx/xlnx_scaler.c
800
801 /**
802 * xv_hscaler_calculate_phases - Calculates h-scaler phases
803 * @scaler: Pointer to scaler registers base
804 * @width_in: input width
805 * @width_out: output width
806 * @pixel_rate: pixel rate
807 *
808 */
809 static void
810 xv_hscaler_calculate_phases(struct xilinx_scaler *scaler,
811 u32 width_in, u32 width_out, u32 pixel_rate)
812 {
813 unsigned int loop_width;
814 unsigned int x, s;
815 int offset = 0;
816 int xwrite_pos = 0;
817 bool output_write_en;
818 bool get_new_pix;
819 u64 phaseH;
820 u32 array_idx = 0;
821 int nr_rds;
822 int nr_rds_clck;
823 unsigned int nphases = scaler->max_num_phases;
824 unsigned int nppc = scaler->pix_per_clk;
825 unsigned int shift = XHSC_STEP_PRECISION_SHIFT - ilog2(nphases);
826
827 loop_width = max_t(u32, width_in, width_out);
828 loop_width = ALIGN(loop_width + nppc - 1, nppc);
829
830 for (x = 0; x < loop_width; x++) {
831 nr_rds_clck = 0;
832 for (s = 0; s < nppc; s++) {
833 phaseH = (offset >> shift) & (nphases - 1);
834 get_new_pix = false;
835 output_write_en = false;
836 if ((offset >> XHSC_STEP_PRECISION_SHIFT) != 0) {
837 get_new_pix = true;
838 offset -= (1 << XHSC_STEP_PRECISION_SHIFT);
839 array_idx++;
840 }
841
842 if (((offset >> XHSC_STEP_PRECISION_SHIFT) == 0) &&
843 xwrite_pos < width_out) {
844 offset += pixel_rate;
845 output_write_en = true;
846 xwrite_pos++;
847 }
848
849 scaler->H_phases[x] |= (phaseH <<
850 (s * XHSC_HPHASE_MULTIPLIER));
851 scaler->H_phases[x] |= (array_idx <<
852 (XHSC_HPHASE_SHIFT_BY_6 +
853 (s * XHSC_HPHASE_MULTIPLIER)));
854 if (output_write_en) {
855 scaler->H_phases[x] |=
856 (XV_HSCALER_PHASESH_V_OUTPUT_WR_EN <<
857 (s * XHSC_HPHASE_MULTIPLIER));
858 }
859
860 if (get_new_pix)
861 nr_rds_clck++;
862 }
863 if (array_idx >= nppc)
864 array_idx &= (nppc - 1);
865
> 866 nr_rds += nr_rds_clck;
867 if (nr_rds >= nppc)
868 nr_rds -= nppc;
869 }
870 }
871
--
0-DAY CI Kernel Test Service
https://01.org/lkp
More information about the linux-arm-kernel
mailing list