Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751949AbaJPQWc (ORCPT ); Thu, 16 Oct 2014 12:22:32 -0400 Received: from mga09.intel.com ([134.134.136.24]:53108 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872AbaJPQWa (ORCPT ); Thu, 16 Oct 2014 12:22:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,733,1406617200"; d="scan'208";a="590269577" Date: Fri, 17 Oct 2014 00:18:56 +0800 From: Fengguang Wu To: Mark Brown Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Wenyou Yang Subject: [PATCH] spi/atmel: fix simple_return.cocci warnings Message-ID: <543feff0.QhS1UtLsJt/o5948%fengguang.wu@intel.com> User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/spi/spi-atmel.c:1518:1-4: WARNING: end returns can be simpified and declaration on line 1514 can be dropped Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci CC: Wenyou Yang Signed-off-by: Fengguang Wu --- Please take the patch only if it's a positive warning. Thanks! spi-atmel.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1511,15 +1511,10 @@ static int atmel_spi_runtime_resume(stru { struct spi_master *master = dev_get_drvdata(dev); struct atmel_spi *as = spi_master_get_devdata(master); - int ret; pinctrl_pm_select_default_state(dev); - ret = clk_prepare_enable(as->clk); - if (ret) - return ret; - - return 0; + return clk_prepare_enable(as->clk); } #endif -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/