From: kernel test robot <lkp@intel.com>
To: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [thermal:thermal/cooling-device-with-id 18/25] drivers/thermal/thermal_core.c:1200:10: warning: variable 'tcd' is uninitialized when used here
Date: Tue, 14 Apr 2026 02:21:34 +0200 [thread overview]
Message-ID: <202604140217.Kmk4ayFu-lkp@intel.com> (raw)
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
next reply other threads:[~2026-04-14 0:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 0:21 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202604140217.Kmk4ayFu-lkp@intel.com \
--to=lkp@intel.com \
--cc=daniel.lezcano@oss.qualcomm.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox