[Sound-open-firmware] [PATCH 09/10] wait: reduce number of nested breaks

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Mon Sep 25 21:52:17 CEST 2017


MISRA-C:2012, 15.4 - There should be no more than one break or goto
statement used to terminate any iteration statement

reshuffle the code to use a single break

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
 src/include/reef/wait.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/include/reef/wait.h b/src/include/reef/wait.h
index 5523de7..c830a75 100644
--- a/src/include/reef/wait.h
+++ b/src/include/reef/wait.h
@@ -114,9 +114,7 @@ static inline int wait_for_completion_timeout(completion_t *comp)
 	/* check for completion after every wake from IRQ */
 	while (1) {
 
-		if (c->complete)
-			break;
-		if (c->timeout)
+		if (c->complete || c->timeout)
 			break;
 
 		wait_for_interrupt(0);
-- 
2.11.0



More information about the Sound-open-firmware mailing list