From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031352AbbD2BLa (ORCPT ); Tue, 28 Apr 2015 21:11:30 -0400 Received: from mga14.intel.com ([192.55.52.115]:59162 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031140AbbD2BL1 (ORCPT ); Tue, 28 Apr 2015 21:11:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,667,1422950400"; d="scan'208";a="720782123" Date: Wed, 29 Apr 2015 09:10:16 +0800 From: kbuild test robot To: Srinivas Pandruvada Cc: kbuild-all@01.org, Zhang Rui , Eduardo Valentin , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Thermal: Intel SoC: fix simple_return.cocci warnings Message-ID: <20150429011016.GA14116@athens> References: <201504290914.FLUcG2uJ%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201504290914.FLUcG2uJ%fengguang.wu@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Fengguang Wu --- intel_soc_dts_iosf.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/drivers/thermal/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel_soc_dts_iosf.c @@ -350,18 +350,13 @@ int intel_soc_dts_iosf_add_read_only_cri struct intel_soc_dts_sensors *sensors, int critical_offset) { int i, j; - int ret; for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { for (j = 0; j < sensors->soc_dts[i].trip_count; ++j) { if (!(sensors->soc_dts[i].trip_mask & BIT(j))) { - ret = update_trip_temp(&sensors->soc_dts[i], j, + return update_trip_temp(&sensors->soc_dts[i], j, sensors->tj_max - critical_offset, THERMAL_TRIP_CRITICAL); - if (ret) - return ret; - - return 0; } } }