dmaengine: at_xdmac: Replace two if statements with only one with two conditions
authorTudor Ambarus <tudor.ambarus@microchip.com>
Tue, 2 Aug 2022 14:06:30 +0000 (17:06 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Sep 2022 06:31:55 +0000 (12:01 +0530)
Add a cosmetic change and replace two if statements with a single if
statement with two conditions. In case the optional txstate parameter is
NULL, we return the dma_cookie_status, which is fine, no functional change
required.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20220802140630.243550-1-tudor.ambarus@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/at_xdmac.c

index b102d8eb5d83d5268185fde99692ea8ae6e8c231..d6c9781cd46afe9b43e0c63c46741d9bde5c8335 100644 (file)
@@ -1470,10 +1470,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
        bool                    initd;
 
        ret = dma_cookie_status(chan, cookie, txstate);
-       if (ret == DMA_COMPLETE)
-               return ret;
-
-       if (!txstate)
+       if (ret == DMA_COMPLETE || !txstate)
                return ret;
 
        spin_lock_irqsave(&atchan->lock, flags);