Skip to contentSkip to conversation

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

PATCH Applied Tudor Ambarus 2 participants 2 messages Aug 2, 2022 – Sep 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: at_xdmac: Replace two if statements with only one with two conditions

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.

---
 drivers/dma/at_xdmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/dma/at_xdmac.c +1 -4
index def564d1e8fa..0aa3ae8d61e4 100644
@@ -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);
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Tudor Ambarus

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

Signature · 1 line
~Vinod