From patchwork Thu Aug 13 17:37:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 7009881 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5FAB2C05AC for ; Thu, 13 Aug 2015 18:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48C4F207AE for ; Thu, 13 Aug 2015 18:11:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 566F3207AA for ; Thu, 13 Aug 2015 18:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753753AbbHMSLl (ORCPT ); Thu, 13 Aug 2015 14:11:41 -0400 Received: from mail-bl2on0103.outbound.protection.outlook.com ([65.55.169.103]:14784 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753761AbbHMSLi (ORCPT ); Thu, 13 Aug 2015 14:11:38 -0400 Received: from BN3PR0301CA0026.namprd03.prod.outlook.com (10.160.180.164) by CY1PR0301MB1305.namprd03.prod.outlook.com (10.161.212.15) with Microsoft SMTP Server (TLS) id 15.1.225.19; Thu, 13 Aug 2015 17:37:45 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::123) by BN3PR0301CA0026.outlook.office365.com (2a01:111:e400:4000::36) with Microsoft SMTP Server (TLS) id 15.1.231.21 via Frontend Transport; Thu, 13 Aug 2015 17:37:45 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; pengutronix.de; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Thu, 13 Aug 2015 17:37:44 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.122]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t7DHbgcs030697; Thu, 13 Aug 2015 10:37:42 -0700 From: Fabio Estevam To: CC: , Fabio Estevam , Lucas Stach Subject: [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence Date: Thu, 13 Aug 2015 14:37:13 -0300 Message-ID: <1439487436-26989-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:oAem1I/cJDd0mWO7aVBZIrjHf1Dj9CLa2Wvpc5ig4xekWBwPyUrdaSm49h7I9KH6ckUYk8j232da2axcJdq5PdSBoavu1UUkUw7FDlqnd+Q/jbCHkTVpO+HnrWLgWlQquJvKPr9vNE76WgAx06j3+3qjTCG/dEa+ju/0S2LpFjOyP5aCfn0o4LeLGfOmaoCFaO/I7rTej6DHVw7wtuhiO4FGIC1YsIRabrZY3/jqat6atrNtWdp2VNq8MPyDBzEZ1F+80KwTQsDVFKlQsu9GE5HmZAWLH1wRfNTm3LYpyebmHFA4W75HTAC/4PjHqpeehg4yJJQ4HlysCj4cE6e9q+IqzHRah65TNTt3LO7sD4sGzuBmQftIX/RjHOOZZv1gVUZ8nNqCU6DlqgZMGpJErA== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(199003)(189002)(106466001)(104016003)(110136002)(36756003)(50986999)(77156002)(69596002)(62966003)(86362001)(105606002)(46102003)(2351001)(229853001)(77096005)(68736005)(5001960100002)(5003940100001)(33646002)(92566002)(19580395003)(6806004)(50466002)(5001830100001)(4001540100001)(87936001)(5001920100001)(5001860100001)(47776003)(50226001)(85426001)(81156007)(97736004)(48376002)(19580405001)(64706001)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1305; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1305; 2:HBrx1sdGNp7asOGFHGH+1vh+UIdGHwiluaN21pwq3e9LJzfzaC2LsAxWKQtAkVSATakqQ+eJHAB+9uySyVRMMnNxlTOnZgls7H1DIxUDzSTK9i5sqwr5D2Q8MAIMlVt+iuK35jZ0NDcmb9rY352/PA8o55GVvTQktofXGySXviQ=; 3:wGOlDXuFv0qKyPz4QUhMR4lUK5TS2tDA0tskwpU7SUJh0vGis/ccCN/mTVMLKJoW5gXzK8tueobQzgluh/KUiBnyb1IDY8II0CV+DqLdDllVGmR7IycxMNsfFGfD8bNsZs8bGu3ZmqUcGVFXg1shknoj/i5MtE3jdjmw/IcwmVTqc9SMJpmtTLD6IPdIIzy+bja/yUOguEBqMTFZWWE7dI5p6iDHP1ATic6BEPvTDXA=; 25:OUHoe5pTffoiNkAO+F//Pwypmk6wcdZsUgunES85H0hF4F/YBTv3iRA+3jQCIVmo73XElvzjcnQ/6gYWq6eE1QaPu7Cwkec4PQjt0JBU4QD6jzIInYabIH3bl6sQSLbv6BFm9eEm+McBcIVonRs105t+EdjxCfNsXTbYDMbgf2BcB6DBsOHE4lil1v0igkxMXL8jv4alX4m3Ku7QdQnZNCWkD1zUDZKJHYX2Kvy72ZbsrZVoTH6qBA0wuBuo3FflKuI40WHUywPSkpT1dD6NCA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1305; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1305; 20:LQZ3W9mgsZAZ8o+BDhTgIAoYyFDP29VCmYJmKzjQVdWzhvvzzbIh5V5ID0/P6klTB3GF+K/yxbgYQTE+eyqubi8fYXw+/70XGSCH5iLIeTRHOotwN8G719kuaKqw9yge3++lDPTpcDTZctbBMgCYx4FZYQFu/NFOflFC2YwQdh7ToCxwaHnQLOabkdPjJLLAcINSNYmC8rIwdoBL4bqYbUYz65m0aS8jJBdyeHuDdINy22/XHoPKJnxTzr88nXMrY1xLEMrkjap8BWbTbgaAzRwaql6yYok28rB2wMd5W/MS2cma/iGoU+n86K+gnAPgKKuSeOQgqSh6ZUK6ZqcEagIlzUaBQ6tmIFwxOTCTio0=; 4:/Pn3otDwPISkSWh342Qc+1wFUz44m0TdJ1+nSsoMPc3sKAcoG7B6ifWVgOuTxL4Wq4erUWSv0q7agtYUfu8bRXSZ5qA6MmJyWeCBtA7qhUj/jiq/JAHPODEUhkFwD+KI71k6vLnV5EDvKVAnBD33nzKqNk3kqNQX7nmhhffV1clZ7iAnUkYT+zys3k4+7sPtVMIQdP6G6bGuboK+yf5tK3iKFnu+kBvDsxBBDKKRnW0zeTltz9XgcN6KNrjdIDwrdyX1zJ3+KnqQ9p7AEZBpClEOGjUxGbcGbJWRDCVDKa4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:CY1PR0301MB1305; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1305; X-Forefront-PRVS: 0667289FF8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1305; 23:iJ5kG+0dhHIq1PnR53S2zQGfvgiXAGDURqHug8m?= =?us-ascii?Q?PD0gTdMmIla46la8wFC0VKTe5vVD2cQm2DbkxFVu1qYj9aXGIAF+WbgBt+U+?= =?us-ascii?Q?IpP+e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0njtx6NZYMKqrNn?= =?us-ascii?Q?+KwQ82SmVDuerZIf9k4vrHLo2xIkN25N6hw+EMtTLHrEubqRWMk3aPApsdxI?= =?us-ascii?Q?LzNQj/VWwa6D36pZm308B6Ewt5jjxBBHyrJ6/ARxOJX0J/oL0JQrSS4a6Zw1?= =?us-ascii?Q?4BWum3AmWsQ8=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1305; 5:/puS2t2lPkJNiUNdkQ8WeRqgxGGUjfke/0wgYFQ9cUnPw63yGPzJ596/refC7xIIZI2bNBMTixALifKbAV4i8sEbHU+s9Fa3K6op46KQXW98wwRmc8BIZLINiYoAqXtsGoodsRw35230zvItVhcf3Q==; 24:v/1+cHsXk5Zy3TIYiFGEY07XrF6JzKI3tL3e66/5AND0EHTU+zwXhT4ocETX6KEh+1wTjBOKiwkkqvn+d5Eg97I9+QbnDTZHupIPreNgYoY=; 20:3hoifrKaJKzq5u2FpaPDsHIWj7l6qgeLHKTnaxYPS6AoEcxTKFGz+GsJXLPg8TeNXkSBYX1urWyMSXQuHS3AAw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2015 17:37:44.7336 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1305 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Simplify a trivial if-return sequence by combining it with a preceding function call. The semantic patch that makes this change is available in scripts/coccinelle/misc/simple_return.cocci. Cc: Lucas Stach Signed-off-by: Fabio Estevam --- drivers/pci/host/pci-imx6.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index 233a196..8f3a981 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -117,11 +117,7 @@ static int pcie_phy_wait_ack(void __iomem *dbi_base, int addr) val = addr << PCIE_PHY_CTRL_DATA_LOC; writel(val, dbi_base + PCIE_PHY_CTRL); - ret = pcie_phy_poll_ack(dbi_base, 0); - if (ret) - return ret; - - return 0; + return pcie_phy_poll_ack(dbi_base, 0); } /* Read from the 16-bit PCIe PHY control registers (not memory-mapped) */ @@ -148,11 +144,7 @@ static int pcie_phy_read(void __iomem *dbi_base, int addr , int *data) /* deassert Read signal */ writel(0x00, dbi_base + PCIE_PHY_CTRL); - ret = pcie_phy_poll_ack(dbi_base, 0); - if (ret) - return ret; - - return 0; + return pcie_phy_poll_ack(dbi_base, 0); } static int pcie_phy_write(void __iomem *dbi_base, int addr, int data)