* [thermal:thermal/cooling-device-with-id 18/25] drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here
@ 2026-04-14 16:44 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-04-14 16:44 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git thermal/cooling-device-with-id
head: 4fea531ae8a1095b1fc1122441fc173a33b93005
commit: 10ad4e2ee1d7bd68d2c7c0d50cb052920305f455 [18/25] thermal/core: Register cooling device non-OF drivers
config: x86_64-buildonly-randconfig-004-20260414 (https://download.01.org/0day-ci/archive/20260415/202604150002.sljttjeq-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260415/202604150002.sljttjeq-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604150002.sljttjeq-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here [-Wuninitialized]
1200 | return tcd;
| ^~~
drivers/thermal/thermal_core.c:1190:43: note: initialize the variable 'tcd' to silence this warning
1190 | struct thermal_cooling_device **ptr, *tcd;
| ^
| = NULL
1 warning generated.
vim +/tcd +1200 drivers/thermal/thermal_core.c
1170
1171 /**
1172 * devm_thermal_cooling_device_register() - register a thermal cooling device
1173 * @dev: a valid struct device pointer of a sensor device.
1174 * @type: the thermal cooling device type.
1175 * @devdata: device private data.
1176 * @ops: standard thermal cooling devices callbacks.
1177 *
1178 * This function will register a cooling device with device tree node reference.
1179 * This interface function adds a new thermal cooling device (fan/processor/...)
1180 * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
1181 * to all the thermal zone devices registered at the same time.
1182 *
1183 * Return: a pointer to the created struct thermal_cooling_device or an
1184 * ERR_PTR. Caller must check return value with IS_ERR*() helpers.
1185 */
1186 struct thermal_cooling_device *
1187 devm_thermal_cooling_device_register(struct device *dev, const char *type,
1188 void *devdata, const struct thermal_cooling_device_ops *ops)
1189 {
1190 struct thermal_cooling_device **ptr, *tcd;
1191
1192 ptr = devres_alloc(thermal_cooling_device_release, sizeof(*ptr),
1193 GFP_KERNEL);
1194 if (!ptr)
1195 return ERR_PTR(-ENOMEM);
1196
1197 thermal_cooling_device_register(type, devdata, ops);
1198 if (IS_ERR(tcd)) {
1199 devres_free(ptr);
> 1200 return tcd;
1201 }
1202
1203 *ptr = tcd;
1204 devres_add(dev, ptr);
1205
1206 return tcd;
1207 }
1208 EXPORT_SYMBOL_GPL(devm_thermal_cooling_device_register);
1209
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* [thermal:thermal/cooling-device-with-id 18/25] drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here
@ 2026-04-14 0:21 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-04-14 0:21 UTC (permalink / raw)
To: Daniel Lezcano; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git thermal/cooling-device-with-id
head: 4fea531ae8a1095b1fc1122441fc173a33b93005
commit: 10ad4e2ee1d7bd68d2c7c0d50cb052920305f455 [18/25] thermal/core: Register cooling device non-OF drivers
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260414/202604140217.Kmk4ayFu-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260414/202604140217.Kmk4ayFu-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202604140217.Kmk4ayFu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here [-Wuninitialized]
1200 | return tcd;
| ^~~
drivers/thermal/thermal_core.c:1190:43: note: initialize the variable 'tcd' to silence this warning
1190 | struct thermal_cooling_device **ptr, *tcd;
| ^
| = NULL
1 warning generated.
vim +/tcd +1200 drivers/thermal/thermal_core.c
1170
1171 /**
1172 * devm_thermal_cooling_device_register() - register a thermal cooling device
1173 * @dev: a valid struct device pointer of a sensor device.
1174 * @type: the thermal cooling device type.
1175 * @devdata: device private data.
1176 * @ops: standard thermal cooling devices callbacks.
1177 *
1178 * This function will register a cooling device with device tree node reference.
1179 * This interface function adds a new thermal cooling device (fan/processor/...)
1180 * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
1181 * to all the thermal zone devices registered at the same time.
1182 *
1183 * Return: a pointer to the created struct thermal_cooling_device or an
1184 * ERR_PTR. Caller must check return value with IS_ERR*() helpers.
1185 */
1186 struct thermal_cooling_device *
1187 devm_thermal_cooling_device_register(struct device *dev, const char *type,
1188 void *devdata, const struct thermal_cooling_device_ops *ops)
1189 {
1190 struct thermal_cooling_device **ptr, *tcd;
1191
1192 ptr = devres_alloc(thermal_cooling_device_release, sizeof(*ptr),
1193 GFP_KERNEL);
1194 if (!ptr)
1195 return ERR_PTR(-ENOMEM);
1196
1197 thermal_cooling_device_register(type, devdata, ops);
1198 if (IS_ERR(tcd)) {
1199 devres_free(ptr);
> 1200 return tcd;
1201 }
1202
1203 *ptr = tcd;
1204 devres_add(dev, ptr);
1205
1206 return tcd;
1207 }
1208 EXPORT_SYMBOL_GPL(devm_thermal_cooling_device_register);
1209
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-14 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-14 16:44 [thermal:thermal/cooling-device-with-id 18/25] drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-04-14 0:21 kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox