tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: aaa11ce2ffc84166d11c4d2ac88c3fcf75425fbd commit: f6f6f9a01374f264b1a6a04d22f330e815bbd471 [8598/9680] thermal/intel/int340x: Replace parameter to simplify config: x86_64-randconfig-a012-20220926 compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=f6f6f9a01374f264b1a6a04d22f330e815bbd471 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout f6f6f9a01374f264b1a6a04d22f330e815bbd471 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/thermal/intel/int340x_thermal/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c:222:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!int34x_thermal_zone->ops) ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c:279:17: note: uninitialized use occurs here return ERR_PTR(ret); ^~~ drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c:222:2: note: remove the 'if' if its condition is always false if (!int34x_thermal_zone->ops) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c:211:9: note: initialize the variable 'ret' to silence this warning int ret; ^ = 0 1 warning generated. vim +222 drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c 203 204 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev, 205 int (*get_temp) (struct thermal_zone_device *, int *)) 206 { 207 struct int34x_thermal_zone *int34x_thermal_zone; 208 acpi_status status; 209 unsigned long long trip_cnt; 210 int trip_mask = 0; 211 int ret; 212 213 int34x_thermal_zone = kzalloc(sizeof(*int34x_thermal_zone), 214 GFP_KERNEL); 215 if (!int34x_thermal_zone) 216 return ERR_PTR(-ENOMEM); 217 218 int34x_thermal_zone->adev = adev; 219 220 int34x_thermal_zone->ops = kmemdup(&int340x_thermal_zone_ops, 221 sizeof(int340x_thermal_zone_ops), GFP_KERNEL); > 222 if (!int34x_thermal_zone->ops) 223 goto err_ops_alloc; 224 225 if (get_temp) 226 int34x_thermal_zone->ops->get_temp = get_temp; 227 228 status = acpi_evaluate_integer(adev->handle, "PATC", NULL, &trip_cnt); 229 if (ACPI_FAILURE(status)) 230 trip_cnt = 0; 231 else { 232 int i; 233 234 int34x_thermal_zone->aux_trips = 235 kcalloc(trip_cnt, 236 sizeof(*int34x_thermal_zone->aux_trips), 237 GFP_KERNEL); 238 if (!int34x_thermal_zone->aux_trips) { 239 ret = -ENOMEM; 240 goto err_trip_alloc; 241 } 242 trip_mask = BIT(trip_cnt) - 1; 243 int34x_thermal_zone->aux_trip_nr = trip_cnt; 244 for (i = 0; i < trip_cnt; ++i) 245 int34x_thermal_zone->aux_trips[i] = THERMAL_TEMP_INVALID; 246 } 247 248 trip_cnt = int340x_thermal_read_trips(int34x_thermal_zone); 249 250 int34x_thermal_zone->lpat_table = acpi_lpat_get_conversion_table( 251 adev->handle); 252 253 int34x_thermal_zone->zone = thermal_zone_device_register( 254 acpi_device_bid(adev), 255 trip_cnt, 256 trip_mask, int34x_thermal_zone, 257 int34x_thermal_zone->ops, 258 &int340x_thermal_params, 259 0, 0); 260 if (IS_ERR(int34x_thermal_zone->zone)) { 261 ret = PTR_ERR(int34x_thermal_zone->zone); 262 goto err_thermal_zone; 263 } 264 ret = thermal_zone_device_enable(int34x_thermal_zone->zone); 265 if (ret) 266 goto err_enable; 267 268 return int34x_thermal_zone; 269 270 err_enable: 271 thermal_zone_device_unregister(int34x_thermal_zone->zone); 272 err_thermal_zone: 273 acpi_lpat_free_conversion_table(int34x_thermal_zone->lpat_table); 274 kfree(int34x_thermal_zone->aux_trips); 275 err_trip_alloc: 276 kfree(int34x_thermal_zone->ops); 277 err_ops_alloc: 278 kfree(int34x_thermal_zone); 279 return ERR_PTR(ret); 280 } 281 EXPORT_SYMBOL_GPL(int340x_thermal_zone_add); 282 -- 0-DAY CI Kernel Test Service https://01.org/lkp