2022-08-02 14:37:04

by Tudor Ambarus

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Tudor Ambarus <[email protected]>
---
drivers/dma/at_xdmac.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

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);
--
2.25.1



2022-09-05 06:56:31

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: at_xdmac: Replace two if statements with only one with two conditions

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

--
~Vinod