Re: [PATCH] PM / devfreq: Add support for QCOM devfreq FW

From: kbuild test robot
Date: Fri May 18 2018 - 12:04:19 EST


Hi Saravana,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.17-rc5 next-20180517]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Saravana-Kannan/PM-devfreq-Add-support-for-QCOM-devfreq-FW/20180518-230524
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

drivers//devfreq/devfreq_qcom_fw.c: In function 'devfreq_qcom_fw_driver_probe':
>> drivers//devfreq/devfreq_qcom_fw.c:127:26: warning: 'prev_freq' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (i > 0 && prev_freq == freq)
~~~~~~~~~~^~~~~~~
drivers//devfreq/devfreq_qcom_fw.c:101:22: note: 'prev_freq' was declared here
unsigned long freq, prev_freq;
^~~~~~~~~

vim +/prev_freq +127 drivers//devfreq/devfreq_qcom_fw.c

96
97 static int devfreq_qcom_populate_opp(struct platform_device *pdev)
98 {
99 struct device *dev = &pdev->dev;
100 u32 data, src, lval, i;
101 unsigned long freq, prev_freq;
102 struct resource *res;
103 void __iomem *lut_base;
104
105 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lut-base");
106 if (!res) {
107 dev_err(dev, "Unable to find lut-base!\n");
108 return -EINVAL;
109 }
110
111 lut_base = devm_ioremap(dev, res->start, resource_size(res));
112 if (!lut_base) {
113 dev_err(dev, "Unable to map lut-base\n");
114 return -ENOMEM;
115 }
116
117 for (i = 0; i < LUT_MAX_ENTRIES; i++) {
118 data = readl_relaxed(lut_base + i * LUT_ROW_SIZE);
119 src = ((data & GENMASK(31, 30)) >> 30);
120 lval = (data & GENMASK(7, 0));
121 freq = src ? XO_RATE * lval : INIT_RATE;
122
123 /*
124 * Two of the same frequencies with the same core counts means
125 * end of table.
126 */
> 127 if (i > 0 && prev_freq == freq)
128 break;
129
130 dev_pm_opp_add(&pdev->dev, freq, 0);
131
132 prev_freq = freq;
133 }
134
135 devm_iounmap(dev, lut_base);
136
137 return 0;
138 }
139

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip