From patchwork Mon Apr 1 04:25:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10879089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33C071390 for ; Mon, 1 Apr 2019 04:27:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18F6D287B6 for ; Mon, 1 Apr 2019 04:27:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C1B02881E; Mon, 1 Apr 2019 04:27:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 85758287B6 for ; Mon, 1 Apr 2019 04:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cGPCpdOKWVxaJsA5m4L/wHOvWBYEDYSvJmg4oJpczK8=; b=DWjmAbXuE7kUvX 47N99pDRhZVYM+VnAUHqZg/Sa+/bANf1BlS5F0hOp63mKAgCUtSX42HUnkEI4NTguy5Z8Tcc8Tzbl qEIhE8nJWLIVYeGs9xZVCCCSXIM2MOajQjr5LJrVCtGcsQ1eaoB4gkKFqnVR+LuYQpjgKytZnDnal feYQhwF7vvuPprxPYyobVzXDeWI6KtwRFwAZGWkAyfYBocQC3WVdJdSAx1Bse2wWkO/uxka2Sa+hj 1XaYblvkOqpc6z4V1ffHuVujD1LTc27vhDNUAta9a6i0DCwkuFftdm6y0CtxKtt2ECEFamvZyvQsj 6jIq4ivrMXYdIIqvbaPA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAoY8-0005Au-UD; Mon, 01 Apr 2019 04:27:56 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hAoWS-0003cK-3S for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 04:26:16 +0000 Received: by mail-pl1-x641.google.com with SMTP id b3so831896plr.7 for ; Sun, 31 Mar 2019 21:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M15SSsqswOiwxhWnX177mGnZWvforApyHb7iTG1lMyk=; b=Kk/se5en2Sz3Z9ozRJsvt0DDkH163RP+1KxrChuxNkDXtcI+ornsyrIb4FUeqE38mk 3lyTAPSM7qKKdFLKAy2FDY0jCGNenhwMhQDXUBbli59hxBATipLzGsqFgFYiylgcocJ6 mPd5s6jXuTiQeRx7+Jox1XXFa8lKRLECwvaF8ZVRsoccXRnyClyMQMasd/v+dGVWkeSn HzN+ivz8pEH8LnwbAwmjn0rqNW8Hy3jCXibBk66JbSrRdx47x2vLsjzrMnUgw9wHN0EC 8BUPNdiqlgJsxZprTWRa7lpU/2yxEfZ4j5gNvnJmFjj/MV6WJTAwdfDpilhOMTsgyFKs lyZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=M15SSsqswOiwxhWnX177mGnZWvforApyHb7iTG1lMyk=; b=FiHtCrknnFABjX/w/BQ/ORDLK86DZHyvNLkjgKv11qf/8UfmWc9RKKNmXE2B5S4Xx/ eS+yY9D8aY2NkosPFpV6JjgwYDgmCROteNc6tlAhvhWT6d/lMAcFIpmHkTV/sBinrLRF SUOWDjVwvmUXjx1/AVwzVSSXdgah6EdI/8M28McMNE7NLas4+jzmO1y4+vzcRCKHQciK SKb+4+6bMgssyIjgC9386jENrXmSusDWE/ZEphpSJn1COVHpuoRq2jQH/CxxlowAafSM Mbw4nkbz3sopCJeRs/lKp343lK3xsHjDyX3VB2u1cK/3UQhjBU4xap1Yr/Vzaki9lTAg O3Pw== X-Gm-Message-State: APjAAAURb3ITcUBJdHuTvB6PEZAGwMOIKuCVBO2r7JQsZHkdSLFH45Av Fs9yROvYmweRsKQyF7B2l7s= X-Google-Smtp-Source: APXvYqwq3u5r+Nbh207nAuIiYhD64NsYeBWNELTtxBIqjDwvuAxTG6ibbn9YVdv+6ZQQsuUtGcbK9A== X-Received: by 2002:a17:902:e90b:: with SMTP id cs11mr3464210plb.243.1554092771562; Sun, 31 Mar 2019 21:26:11 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id t22sm10996829pgu.45.2019.03.31.21.26.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 Mar 2019 21:26:10 -0700 (PDT) From: Andrey Smirnov To: linux-pci@vger.kernel.org Subject: [PATCH v3 08/11] PCI: imx6: Simplify pcie_phy_poll_ack() Date: Sun, 31 Mar 2019 21:25:44 -0700 Message-Id: <20190401042547.14067-9-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190401042547.14067-1-andrew.smirnov@gmail.com> References: <20190401042547.14067-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190331_212612_515107_7CFFCE60 X-CRM114-Status: GOOD ( 14.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "A.s. Dong" , Lorenzo Pieralisi , Richard Zhu , linux-arm-kernel@lists.infradead.org, Andrey Smirnov , linux-kernel@vger.kernel.org, Fabio Estevam , linux-imx@nxp.com, Bjorn Helgaas , Leonard Crestez , Chris Healy , Lucas Stach Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Simplify pcie_phy_poll_ack() by incorporating shifting into constant definition and convert the code to use 'bool'. No functional change intended. Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Fabio Estevam Cc: Chris Healy Cc: Lucas Stach Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org Signed-off-by: Andrey Smirnov --- drivers/pci/controller/dwc/pci-imx6.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index a49e5e491e12..7c3ffb751002 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -112,7 +112,7 @@ struct imx6_pcie { #define PCIE_PHY_CTRL_RD BIT(19) #define PCIE_PHY_STAT (PL_OFFSET + 0x110) -#define PCIE_PHY_STAT_ACK_LOC 16 +#define PCIE_PHY_STAT_ACK BIT(16) #define PCIE_LINK_WIDTH_SPEED_CONTROL 0x80C @@ -151,16 +151,16 @@ struct imx6_pcie { #define PHY_RX_OVRD_IN_LO_RX_DATA_EN BIT(5) #define PHY_RX_OVRD_IN_LO_RX_PLL_EN BIT(3) -static int pcie_phy_poll_ack(struct imx6_pcie *imx6_pcie, int exp_val) +static int pcie_phy_poll_ack(struct imx6_pcie *imx6_pcie, bool exp_val) { struct dw_pcie *pci = imx6_pcie->pci; - u32 val; + bool val; u32 max_iterations = 10; u32 wait_counter = 0; do { - val = dw_pcie_readl_dbi(pci, PCIE_PHY_STAT); - val = (val >> PCIE_PHY_STAT_ACK_LOC) & 0x1; + val = dw_pcie_readl_dbi(pci, PCIE_PHY_STAT) & + PCIE_PHY_STAT_ACK; wait_counter++; if (val == exp_val)