From patchwork Thu Oct 16 16:18:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fengguang Wu X-Patchwork-Id: 5092581 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7D315C11AC for ; Thu, 16 Oct 2014 16:22:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0B3C201D3 for ; Thu, 16 Oct 2014 16:22:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D86AE201B9 for ; Thu, 16 Oct 2014 16:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751875AbaJPQWb (ORCPT ); Thu, 16 Oct 2014 12:22:31 -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 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 16 Oct 2014 09:16:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,733,1406617200"; d="scan'208";a="590269577" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by orsmga001.jf.intel.com with ESMTP; 16 Oct 2014 09:19:20 -0700 Received: from kbuild by bee with local (Exim 4.83) (envelope-from ) id 1Xenln-0000D2-DC; Fri, 17 Oct 2014 00:19:19 +0800 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 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-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Nicolas Ferre --- Please take the patch only if it's a positive warning. Thanks! spi-atmel.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 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