[Sound-open-firmware] [PATCH] dw-dma: simplify conditional statement

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Fri Mar 9 00:43:58 CET 2018


detected with sonarcloud: fix pointer test and avoid
redundant evaluation of lli as always true.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
 src/drivers/dw-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/drivers/dw-dma.c b/src/drivers/dw-dma.c
index f6f776a..7659bec 100644
--- a/src/drivers/dw-dma.c
+++ b/src/drivers/dw-dma.c
@@ -779,7 +779,7 @@ static inline void dw_dma_chan_reload_lli(struct dma *dma, int channel)
 	struct dw_lli2 *lli = p->chan[channel].lli_current;
 
 	/* only need to reload if this is a block transfer */
-	if (lli == 0 || (lli && lli->llp == 0)) {
+	if (!lli || lli->llp == 0) {
 		p->chan[channel].status = COMP_STATE_PREPARE;
 		return;
 	}
-- 
2.14.1



More information about the Sound-open-firmware mailing list