[kbuild] [drm-drm-misc:drm-misc-next 10/24] drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.
From: Dan Carpenter
Date: Thu Aug 12 2021 - 07:52:01 EST
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 2ca380ea0e6a31046b7c4048e3f61cfc2f6b2aa3
commit: 2545ac960364d0395802a27374b46f13827b4cf5 [10/24] drm/mgag200: Abstract pixel PLL via struct mgag200_pll
config: x86_64-randconfig-m001-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
smatch warnings:
drivers/gpu/drm/mgag200/mgag200_pll.c:142 mgag200_pixpll_compute_g200se_00() error: uninitialized symbol 'delta'.
vim +/delta +142 drivers/gpu/drm/mgag200/mgag200_pll.c
2545ac960364d0 Thomas Zimmermann 2021-07-14 114 static int mgag200_pixpll_compute_g200se_00(struct mgag200_pll *pixpll, long clock,
2545ac960364d0 Thomas Zimmermann 2021-07-14 115 struct mgag200_pll_values *pixpllc)
2545ac960364d0 Thomas Zimmermann 2021-07-14 116 {
2545ac960364d0 Thomas Zimmermann 2021-07-14 117 static const unsigned int vcomax = 320000;
2545ac960364d0 Thomas Zimmermann 2021-07-14 118 static const unsigned int vcomin = 160000;
2545ac960364d0 Thomas Zimmermann 2021-07-14 119 static const unsigned int pllreffreq = 25000;
2545ac960364d0 Thomas Zimmermann 2021-07-14 120
2545ac960364d0 Thomas Zimmermann 2021-07-14 121 unsigned int delta, tmpdelta, permitteddelta;
^^^^^^^^^^^^^^^^^^
2545ac960364d0 Thomas Zimmermann 2021-07-14 122 unsigned int testp, testm, testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14 123 unsigned int p, m, n, s;
2545ac960364d0 Thomas Zimmermann 2021-07-14 124 unsigned int computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14 125
2545ac960364d0 Thomas Zimmermann 2021-07-14 126 m = n = p = s = 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14 127 permitteddelta = clock * 5 / 1000;
2545ac960364d0 Thomas Zimmermann 2021-07-14 128
2545ac960364d0 Thomas Zimmermann 2021-07-14 129 for (testp = 8; testp > 0; testp /= 2) {
2545ac960364d0 Thomas Zimmermann 2021-07-14 130 if (clock * testp > vcomax)
2545ac960364d0 Thomas Zimmermann 2021-07-14 131 continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14 132 if (clock * testp < vcomin)
2545ac960364d0 Thomas Zimmermann 2021-07-14 133 continue;
2545ac960364d0 Thomas Zimmermann 2021-07-14 134
2545ac960364d0 Thomas Zimmermann 2021-07-14 135 for (testn = 17; testn < 256; testn++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14 136 for (testm = 1; testm < 32; testm++) {
2545ac960364d0 Thomas Zimmermann 2021-07-14 137 computed = (pllreffreq * testn) / (testm * testp);
2545ac960364d0 Thomas Zimmermann 2021-07-14 138 if (computed > clock)
2545ac960364d0 Thomas Zimmermann 2021-07-14 139 tmpdelta = computed - clock;
2545ac960364d0 Thomas Zimmermann 2021-07-14 140 else
2545ac960364d0 Thomas Zimmermann 2021-07-14 141 tmpdelta = clock - computed;
2545ac960364d0 Thomas Zimmermann 2021-07-14 @142 if (tmpdelta < delta) {
"delta" is not intialized until the next line.
2545ac960364d0 Thomas Zimmermann 2021-07-14 143 delta = tmpdelta;
2545ac960364d0 Thomas Zimmermann 2021-07-14 144 m = testm;
2545ac960364d0 Thomas Zimmermann 2021-07-14 145 n = testn;
2545ac960364d0 Thomas Zimmermann 2021-07-14 146 p = testp;
2545ac960364d0 Thomas Zimmermann 2021-07-14 147 }
2545ac960364d0 Thomas Zimmermann 2021-07-14 148 }
2545ac960364d0 Thomas Zimmermann 2021-07-14 149 }
2545ac960364d0 Thomas Zimmermann 2021-07-14 150 }
2545ac960364d0 Thomas Zimmermann 2021-07-14 151
2545ac960364d0 Thomas Zimmermann 2021-07-14 152 if (delta > permitteddelta) {
2545ac960364d0 Thomas Zimmermann 2021-07-14 153 pr_warn("PLL delta too large\n");
2545ac960364d0 Thomas Zimmermann 2021-07-14 154 return -EINVAL;
2545ac960364d0 Thomas Zimmermann 2021-07-14 155 }
2545ac960364d0 Thomas Zimmermann 2021-07-14 156
2545ac960364d0 Thomas Zimmermann 2021-07-14 157 pixpllc->m = m;
2545ac960364d0 Thomas Zimmermann 2021-07-14 158 pixpllc->n = n;
2545ac960364d0 Thomas Zimmermann 2021-07-14 159 pixpllc->p = p;
2545ac960364d0 Thomas Zimmermann 2021-07-14 160 pixpllc->s = s;
2545ac960364d0 Thomas Zimmermann 2021-07-14 161
2545ac960364d0 Thomas Zimmermann 2021-07-14 162 return 0;
2545ac960364d0 Thomas Zimmermann 2021-07-14 163 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
_______________________________________________
kbuild mailing list -- kbuild@xxxxxxxxxxxx
To unsubscribe send an email to kbuild-leave@xxxxxxxxxxxx