From patchwork Tue Apr 17 14:29:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 10345263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8A6460548 for ; Tue, 17 Apr 2018 14:31:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEF8C2851E for ; Tue, 17 Apr 2018 14:31:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA43028560; Tue, 17 Apr 2018 14:31:13 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D5AC2851E for ; Tue, 17 Apr 2018 14:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbeDQObA (ORCPT ); Tue, 17 Apr 2018 10:31:00 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:31372 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753012AbeDQOa4 (ORCPT ); Tue, 17 Apr 2018 10:30:56 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180417143055epoutp036b4e37fe251db0a63957a989190bfa76~mP5ovwCm00051200512epoutp03i; Tue, 17 Apr 2018 14:30:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180417143055epoutp036b4e37fe251db0a63957a989190bfa76~mP5ovwCm00051200512epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523975455; bh=WAvcl1lJaOKhL+vLO6wJI+eJpCuF18wysHbn6r+o8Q8=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=LW/sfRomMrEII7R+s+9TsGGDrAIaOd/Hg5CClnDfi6+ieAB68Yo1PcQ0/phqX64H/ 02wrEoTtCyIwM9vqqCq4UyflSL9lPdRJv3T0E8BdHDoiYZcL4YSjUM7M3ch/AA6nk0 sMIqe9K6iAk/+FeXZ5JZZXK8gDLc9VI1X+awQdvE= Received: from epsmges1p3.samsung.com (unknown [182.195.42.55]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180417143055epcas1p1737e3f28eaf6fbeb57c08c5ab2d4a1ab~mP5oiLxzJ0741807418epcas1p1K; Tue, 17 Apr 2018 14:30:55 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p3.samsung.com (Symantec Messaging Gateway) with SMTP id 63.11.04070.F1506DA5; Tue, 17 Apr 2018 23:30:55 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d~mP5nYccED0363203632epcas1p21; Tue, 17 Apr 2018 14:30:53 +0000 (GMT) X-AuditID: b6c32a37-55dff70000000fe6-f7-5ad6051f8343 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 93.80.03849.D1506DA5; Tue, 17 Apr 2018 23:30:53 +0900 (KST) Received: from AMDC3061.digital.local ([106.116.147.40]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P7C0012A2Y8EI10@mmp1.samsung.com>; Tue, 17 Apr 2018 23:30:53 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Cc: andi@etezian.org, krzk@kernel.org, kgene@kernel.org, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, Sylwester Nawrocki Subject: [PATCH v2 7/8] spi: spi-s3c64xx: Use local variable for FIFO length Date: Tue, 17 Apr 2018 16:29:53 +0200 Message-id: <20180417142954.5507-7-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.14.2 In-reply-to: <20180417142954.5507-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRmVeSWpSXmKPExsWy7bCmnq4867Uog7+vmSwW/3jOZLFxxnpW i6kPn7BZ9D9+zWxx/vwGdotNj6+xWsw4v4/JovHjTXaLtUfuslscftPO6sDlcX3JJ2aPTas6 2Tw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroy5n/+xFbRzVnyZv4m5gXEjexcjJ4eE gInEqnm/WbsYuTiEBHYwSkx5f5MRwvnOKDHt7DS4qi/z3rNBJHYzSnzetAqq5RejxO+zK5lB qtgEDCV6j/YxgtgiAmISt+d0MoMUMQs0MUm0PljHCpIQFvCRWPp+GhuIzSKgKnF2/wmwBl4B K4mbv4+wQayTl3i/4D5QnIODU8BaYn+nCMgcCYEFbBI/JixiBolLCLhILN3mAFEuLPHq+BZ2 iLC0xKWjthDhaonOti52iNYWRok/0y5BjbeWOHz8Itg5zAJ8Eu++9rBC9PJKdLQJQZR4SDx+ u5YFwnaUaD7fC/VvH6PEis+3mScwSi1gZFjFKJZaUJybnlpsWGCsV5yYW1yal66XnJ+7iREc sVrmOxg3nPM5xCjAwajEwyux40qUEGtiWXFl7iFGCQ5mJRHenY+BQrwpiZVVqUX58UWlOanF hxilOViUxHmf+pyJEhJITyxJzU5NLUgtgskycXBKNTDGrHo6wWL3d2+eayxBcyZWtB5duunY vAMLFikeu896anrNI33x0AV/nmWVfnqZwVVyRP8474own5chKxSXTtQKKl51I+3Dus3rLPYs sBPo18u//qbpZMaKpI76iRczpI7I2EdN+T/3cbEv95PduWZ//kRtfCAjceJ2+Jt78zYnHWG9 nb+jYXKwuBJLcUaioRZzUXEiAFtgc3zUAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJLMWRmVeSWpSXmKPExsVy+t9jAV1Z1mtRBlN7TCwW/3jOZLFxxnpW i6kPn7BZ9D9+zWxx/vwGdotNj6+xWsw4v4/JovHjTXaLtUfuslscftPO6sDlcX3JJ2aPTas6 2Tw2L6n36NuyitHj8ya5ANYoLpuU1JzMstQifbsEroy5n/+xFbRzVnyZv4m5gXEjexcjJ4eE gInEl3nv2boYuTiEBHYySmxedJsFwvnFKHHs5R2wKjYBQ4neo32MILaIgJjE7TmdzCBFzAJN TBLvP39mBkkIC/hILH0/jQ3EZhFQlTi7/wRYA6+AlcTN30fYINbJS7xfcB8ozsHBKWAtsb9T BMQUAipZ9k9wAiPPAkaGVYySqQXFuem5xUYFhnmp5XrFibnFpXnpesn5uZsYgQG27bBW3w7G +0viDzEKcDAq8fBK7LgSJcSaWFZcmXuIUYKDWUmEd+djoBBvSmJlVWpRfnxRaU5q8SFGaQ4W JXHe23nHIoUE0hNLUrNTUwtSi2CyTBycUg2MotuSv+js3rTrpAvLEdZIHoNej30NZ8Stw589 2cfqdSnoWcnZMp3OelUtoSv7dO0ZpG7FFVT8Dsh4yS9swflu+src/rBjl8Klj8/IiH7EK7+h /w1ve+GWW73nuMp3zT+2+jN3ZajGJbPIFmHX1QsufLR6r3NVpbrpw52DRWbeGbeVL/C8qk1X YinOSDTUYi4qTgQAYO2fNCwCAAA= X-CMS-MailID: 20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d X-RootMTR: 20180417143053epcas1p2a1bf34ea178d1f20fee3c6ade18bf17d References: <20180417142954.5507-1-s.nawrocki@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP More references to fifo_len are added in subsequent patch. Signed-off-by: Sylwester Nawrocki Reviewed-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index db33bc9b4147..27cd8c59eabf 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -634,6 +634,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, struct spi_transfer *xfer) { struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master); + const unsigned int fifo_len = (FIFO_LVL_MASK(sdd) >> 1) + 1; int status; u32 speed; u8 bpw; @@ -655,9 +656,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, /* Polling method for xfers not bigger than FIFO capacity */ use_dma = 0; - if (!is_polling(sdd) && - (sdd->rx_dma.ch && sdd->tx_dma.ch && - (xfer->len > ((FIFO_LVL_MASK(sdd) >> 1) + 1)))) + if (!is_polling(sdd) && (xfer->len > fifo_len) && + sdd->rx_dma.ch && sdd->tx_dma.ch) use_dma = 1; spin_lock_irqsave(&sdd->lock, flags);