drivers/cpufreq/spear-cpufreq.c:202:12: warning: variable 'i' is uninitialized when used here
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/arm/linux-next head: dca2ef2b7d916c718c6e88084170413a8a1942d0 commit: dca2ef2b7d916c718c6e88084170413a8a1942d0 [2/2] cpufreq: spear: Use of_property_for_each_u32() instead of open coding config: arm-defconfig (https://download.01.org/0day-ci/archive/20240803/[email protected]/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240803/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> drivers/cpufreq/spear-cpufreq.c:202:12: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
freq_tbl[i].frequency = val;
^
drivers/cpufreq/spear-cpufreq.c:176:12: note: initialize the variable 'i' to silence this warning
int cnt, i, ret;
^
= 01 warning generated.
vim +/i +202 drivers/cpufreq/spear-cpufreq.c
170
171 static int spear_cpufreq_probe(struct platform_device *pdev)
172 {
173 struct device_node *np;
174 struct cpufreq_frequency_table *freq_tbl;
175 u32 val;
176 int cnt, i, ret;
177
178 np = of_cpu_device_node_get(0);
179 if (!np) {
180 pr_err("No cpu node found\n");
181 return -ENODEV;
182 }
183
184 if (of_property_read_u32(np, "clock-latency",
185 &spear_cpufreq.transition_latency))
186 spear_cpufreq.transition_latency = CPUFREQ_ETERNAL;
187
188 cnt = of_property_count_u32_elems(np, "cpufreq_tbl");
189 if (cnt <= 0) {
190 pr_err("Invalid cpufreq_tbl\n");
191 ret = -ENODEV;
192 goto out_put_node;
193 }
194
195 freq_tbl = kcalloc(cnt + 1, sizeof(*freq_tbl), GFP_KERNEL);
196 if (!freq_tbl) {
197 ret = -ENOMEM;
198 goto out_put_node;
199 }
200
201 of_property_for_each_u32(np, "cpufreq_tbl", val)
> 202 freq_tbl[i].frequency = val;
203
204 freq_tbl[cnt].frequency = CPUFREQ_TABLE_END;
205
206 spear_cpufreq.freq_tbl = freq_tbl;
207
208 of_node_put(np);
209
210 spear_cpufreq.clk = clk_get(NULL, "cpu_clk");
211 if (IS_ERR(spear_cpufreq.clk)) {
212 pr_err("Unable to get CPU clock\n");
213 ret = PTR_ERR(spear_cpufreq.clk);
214 goto out_put_mem;
215 }
216
217 ret = cpufreq_register_driver(&spear_cpufreq_driver);
218 if (!ret)
219 return 0;
220
221 pr_err("failed register driver: %d\n", ret);
222 clk_put(spear_cpufreq.clk);
223
224 out_put_mem:
225 kfree(freq_tbl);
226 return ret;
227
228 out_put_node:
229 of_node_put(np);
230 return ret;
231 }
232
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 21 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/arm/linux-next head: dca2ef2b7d916c718c6e88084170413a8a1942d0 commit: dca2ef2b7d916c718c6e88084170413a8a1942d0 [2/2] cpufreq: spear: Use of_property_for_each_u32() instead of open coding config: arm-defconfig (https://download.01.org/0day-ci/archive/20240803/[email protected]/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240803/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/cpufreq/spear-cpufreq.c:202:12: warning: variable 'i' is uninitialized when used here [-Wuninitialized]freq_tbl[i].frequency = val; ^ drivers/cpufreq/spear-cpufreq.c:176:12: note: initialize the variable 'i' to silence this warning int cnt, i, ret; ^ = 0
Quoted 4 lines
1 warning generated.
vim +/i +202
drivers/cpufreq/spear-cpufreq.c
Rob, can you please send a fix for this ?
Signature · 1 line
viresh
Quoted 26 lines · Viresh Kumar
Quoted 24 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/arm/linux-next head: dca2ef2b7d916c718c6e88084170413a8a1942d0 commit: dca2ef2b7d916c718c6e88084170413a8a1942d0 [2/2] cpufreq: spear: Use of_property_for_each_u32() instead of open coding config: arm-defconfig (https://download.01.org/0day-ci/archive/20240803/[email protected]/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240803/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/cpufreq/spear-cpufreq.c:202:12: warning: variable 'i' is uninitialized when used here [-Wuninitialized]freq_tbl[i].frequency = val; ^ drivers/cpufreq/spear-cpufreq.c:176:12: note: initialize the variable 'i' to silence this warning int cnt, i, ret; ^ = 01 warning generated.
Quoted 3 lines
Quoted 1 line
vim +/i +202
drivers/cpufreq/spear-cpufreq.cRob, can you please send a fix for this ?
Will do. Looks like it is only with clang...
Is there some reason COMPILE_TEST is not enabled for almost everything in cpufreq/?
Rob
Quoted 28 lines · Rob Herring
Quoted 26 lines · Viresh Kumar
Quoted 24 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/arm/linux-next head: dca2ef2b7d916c718c6e88084170413a8a1942d0 commit: dca2ef2b7d916c718c6e88084170413a8a1942d0 [2/2] cpufreq: spear: Use of_property_for_each_u32() instead of open coding config: arm-defconfig (https://download.01.org/0day-ci/archive/20240803/[email protected]/config) compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240803/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All warnings (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/cpufreq/spear-cpufreq.c:202:12: warning: variable 'i' is uninitialized when used here [-Wuninitialized]freq_tbl[i].frequency = val; ^ drivers/cpufreq/spear-cpufreq.c:176:12: note: initialize the variable 'i' to silence this warning int cnt, i, ret; ^ = 01 warning generated.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
vim +/i +202
drivers/cpufreq/spear-cpufreq.cRob, can you please send a fix for this ?
Will do. Looks like it is only with clang...
Is there some reason
COMPILE_TESTis not enabled for almost everything in cpufreq/?
Pushed this out for builders to test:
https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/log/?h=cpufreq-compile-test
Quoted 3 lines · Rob Herring
Quoted 2 lines · Rob Herring
Is there some reason
COMPILE_TESTis not enabled for almost everything in cpufreq/?
Not sure why.
Quoted 3 lines
Pushed this out for builders to test:
https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/log/?h=cpufreq-compile-test
Thanks. Would be good to get these merged.
Signature · 1 line
viresh