diff mbox series

dmaengine: at_xdmac: Replace two if statements with only one with two conditions

Message ID 20220802140630.243550-1-tudor.ambarus@microchip.com (mailing list archive)
State Accepted
Commit 64787536ccfc072dca9b2c7c06c84dcc3f139b10
Headers show
Series dmaengine: at_xdmac: Replace two if statements with only one with two conditions | expand

Commit Message

Tudor Ambarus Aug. 2, 2022, 2:06 p.m. UTC
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>
---
 drivers/dma/at_xdmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Vinod Koul Sept. 5, 2022, 6:32 a.m. UTC | #1
On 02-08-22, 17:06, Tudor Ambarus wrote:
> 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.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
index def564d1e8fa..0aa3ae8d61e4 100644
--- a/drivers/dma/at_xdmac.c
+++ b/drivers/dma/at_xdmac.c
@@ -1463,10 +1463,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);