Re: [PATCH V9 4/4] thermal: qcom: add support for PMIC5 Gen3 ADC thermal monitoring

From: kernel test robot

Date: Wed Jan 28 2026 - 15:56:41 EST


Hi Jishnu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 63804fed149a6750ffd28610c5c1c98cce6bd377]

url: https://github.com/intel-lab-lkp/linux/commits/Jishnu-Prakash/dt-bindings-iio-adc-Split-out-QCOM-VADC-channel-properties/20260128-193116
base: 63804fed149a6750ffd28610c5c1c98cce6bd377
patch link: https://lore.kernel.org/r/20260128112420.695518-5-jishnu.prakash%40oss.qualcomm.com
patch subject: [PATCH V9 4/4] thermal: qcom: add support for PMIC5 Gen3 ADC thermal monitoring
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260129/202601290438.IXYMj3d2-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260129/202601290438.IXYMj3d2-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202601290438.IXYMj3d2-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c:180:9: warning: variable 'upper_set' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
180 | if (ret)
| ^~~
drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c:188:9: note: uninitialized use occurs here
188 | if (!(upper_set || lower_set))
| ^~~~~~~~~
drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c:180:5: note: remove the 'if' if its condition is always false
180 | if (ret)
| ^~~~~~~~
181 | break;
| ~~~~~
drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c:171:17: note: initialize the variable 'upper_set' to silence this warning
171 | bool upper_set, lower_set;
| ^
| = 0
1 warning generated.


vim +180 drivers/thermal/qcom/qcom-spmi-adc-tm5-gen3.c

159
160 static void tm_handler_work(struct work_struct *work)
161 {
162 struct adc_tm5_gen3_chip *adc_tm5 = container_of(work, struct adc_tm5_gen3_chip,
163 tm_handler_work);
164 int sdam_index = -1;
165 u8 tm_status[2] = { };
166 u8 buf[16] = { };
167
168 for (int i = 0; i < adc_tm5->nchannels; i++) {
169 struct adc_tm5_gen3_channel_props *chan_prop = &adc_tm5->chan_props[i];
170 int offset = chan_prop->tm_chan_index;
171 bool upper_set, lower_set;
172 int ret, temp;
173 u16 code;
174
175 scoped_guard(adc5_gen3, adc_tm5) {
176 if (chan_prop->sdam_index != sdam_index) {
177 sdam_index = chan_prop->sdam_index;
178 ret = adc5_gen3_tm_status_check(adc_tm5, sdam_index,
179 tm_status, buf);
> 180 if (ret)
181 break;
182 }
183
184 upper_set = ((tm_status[0] & BIT(offset)) && chan_prop->high_thr_en);
185 lower_set = ((tm_status[1] & BIT(offset)) && chan_prop->low_thr_en);
186 }
187
188 if (!(upper_set || lower_set))
189 continue;
190
191 code = get_unaligned_le16(&buf[2 * offset]);
192 dev_dbg(adc_tm5->dev, "ADC_TM threshold code:%#x\n", code);
193
194 ret = adc5_gen3_therm_code_to_temp(adc_tm5->dev,
195 &chan_prop->common_props,
196 code, &temp);
197 if (ret) {
198 dev_err(adc_tm5->dev,
199 "Invalid temperature reading, ret = %d, code=%#x\n",
200 ret, code);
201 continue;
202 }
203
204 chan_prop->last_temp = temp;
205 chan_prop->last_temp_set = true;
206 thermal_zone_device_update(chan_prop->tzd, THERMAL_TRIP_VIOLATED);
207 }
208 }
209

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki