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: 10345325 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 900E9601D7 for ; Tue, 17 Apr 2018 14:35:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 714F1209CE for ; Tue, 17 Apr 2018 14:35:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 654CD21FAD; Tue, 17 Apr 2018 14:35:23 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 E4E1F209CE for ; Tue, 17 Apr 2018 14:35:22 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=i1jR85PUhhTeYtC9XiUYqUjRgjeHuLzdToXHsRC/nsU=; b=LjdX7bSEIUagH/T+pjMhA594oO zObhSbhBJqvu9Ci2WFZhsdUUfp5HDwfx2Uvc1zbHi7hBgiQvbNkEMQDtbbVysD1ADAkK+IlroTOnD 22QFEgmmH1dKdS63zEGFq2z21reCZKHcaOZnl3NJUm4YVM1vjOMM1iiaFj2rBdHNu9d0i+FI4w6zJ tPw9e75sz7nNvC3hhLY3H7FpBL4rfzXu4xQertynhgcgqhMFMI9aygbU+Ve5lLvR6Rta76yBs8zHD AjQQAGn8orhAGqz57sWxv12A56a/7aUU7/qWNGwvL+WxycWzOfzEZhxphLNUkMdMPaer1kTnKSv3q +Mht5vNA==; 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 1f8RhO-0003Ai-NY; Tue, 17 Apr 2018 14:35:10 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f8RdT-0000RW-0m for linux-arm-kernel@lists.infradead.org; Tue, 17 Apr 2018 14:31:13 +0000 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 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+z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4neo32MILaIgJjE7TmdzCBFzAJN 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180417_073107_348168_9C47A1D1 X-CRM114-Status: GOOD ( 17.16 ) 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: linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki , b.zolnierkie@samsung.com, krzk@kernel.org, linux-spi@vger.kernel.org, kgene@kernel.org, andi@etezian.org, linux-arm-kernel@lists.infradead.org, m.szyprowski@samsung.com MIME-Version: 1.0 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 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);