Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416465

[PATCH 4/8] dmaengine: s3c24xx: Simplify code in s3c24xx_dma_tx_status()

From Peter Griffin <peter.griffin@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 4/8] dmaengine: s3c24xx: Simplify code in s3c24xx_dma_tx_status()
Date 2016-06-07 19:50 +0200
Message-ID <rHtix-5Fq-23@gated-at.bofh.it> (permalink)
References <rHt8R-5BX-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Doing so saves a few lines of code in the driver.

Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
 drivers/dma/s3c24xx-dma.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
index 17ccdfd..f7d2c7a 100644
--- a/drivers/dma/s3c24xx-dma.c
+++ b/drivers/dma/s3c24xx-dma.c
@@ -768,16 +768,12 @@ static enum dma_status s3c24xx_dma_tx_status(struct dma_chan *chan,
 
 	spin_lock_irqsave(&s3cchan->vc.lock, flags);
 	ret = dma_cookie_status(chan, cookie, txstate);
-	if (ret == DMA_COMPLETE) {
-		spin_unlock_irqrestore(&s3cchan->vc.lock, flags);
-		return ret;
-	}
 
 	/*
 	 * There's no point calculating the residue if there's
 	 * no txstate to store the value.
 	 */
-	if (!txstate) {
+	if (ret == DMA_COMPLETE || !txstate) {
 		spin_unlock_irqrestore(&s3cchan->vc.lock, flags);
 		return ret;
 	}
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/8]  Various dmaengine cleanups Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:40 +0200
  [PATCH 8/8] dmaengine: Remove site specific OOM error messages on kzalloc Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:40 +0200
    Re: [PATCH 8/8] dmaengine: Remove site specific OOM error messages on  kzalloc Jon Hunter <jonathanh@nvidia.com> - 2016-06-08 10:30 +0200
    Re: [PATCH 8/8] dmaengine: Remove site specific OOM error messages on kzalloc Linus Walleij <linus.walleij@linaro.org> - 2016-06-08 14:20 +0200
      Re: [PATCH 8/8] dmaengine: Remove site specific OOM error messages  on kzalloc Lee Jones <lee.jones@linaro.org> - 2016-06-09 17:40 +0200
  [PATCH 3/8] dmaengine: coh901318: Only calculate residue if txstate exists. Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:40 +0200
    Re: [PATCH 3/8] dmaengine: coh901318: Only calculate residue if  txstate exists. Linus Walleij <linus.walleij@linaro.org> - 2016-06-08 14:20 +0200
  [PATCH 5/8] dmaengine: ste_dma40: Only calculate residue if txstate exists. Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:40 +0200
    Re: [PATCH 5/8] dmaengine: ste_dma40: Only calculate residue if  txstate exists. Linus Walleij <linus.walleij@linaro.org> - 2016-06-08 14:20 +0200
  [PATCH 2/8] dmaengine: fsl-edma: print error code in error messages. Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:50 +0200
  [PATCH 6/8] dmaengine: sun6i-dma: Only calculate residue if state exists. Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:50 +0200
  [PATCH 1/8] dmaengine: fsl-edma: Fix clock handling error paths Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:50 +0200
  [PATCH 4/8] dmaengine: s3c24xx: Simplify code in s3c24xx_dma_tx_status() Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:50 +0200
  [PATCH 7/8] dmaengine: tegra20-apb-dma: Only calculate residue if txstate exists. Peter Griffin <peter.griffin@linaro.org> - 2016-06-07 19:50 +0200
    Re: [PATCH 7/8] dmaengine: tegra20-apb-dma: Only calculate residue if  txstate exists. Jon Hunter <jonathanh@nvidia.com> - 2016-06-08 11:10 +0200

csiph-web