Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Thermal: Intel SoC: fix simple_return.cocci warnings

drivers/thermal/intel_soc_dts_iosf.c:358:4-7: WARNING: end returns can be simpified

Simplify a trivial if-return sequence. Possibly combine with a
preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>

authored by

Wu Fengguang and committed by
Zhang Rui
bd7081ae 8c187693

+1 -6
+1 -6
drivers/thermal/intel_soc_dts_iosf.c
··· 350 350 struct intel_soc_dts_sensors *sensors, int critical_offset) 351 351 { 352 352 int i, j; 353 - int ret; 354 353 355 354 for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { 356 355 for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { 357 356 if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { 358 - ret = update_trip_temp(&sensors->soc_dts[i], j, 357 + return update_trip_temp(&sensors->soc_dts[i], j, 359 358 sensors->tj_max - critical_offset, 360 359 THERMAL_TRIP_CRITICAL); 361 - if (ret) 362 - return ret; 363 - 364 - return 0; 365 360 } 366 361 } 367 362 }