[Cbe-oss-dev] [PATCH 5/5] MARS: cleanup task queue push/pop error checking

Yuji Mano Yuji.Mano at am.sony.com
Tue Jul 15 10:26:43 EST 2008


Clean up some error checking on MPU-side task queue
push and pop routines.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
 src/mpu/lib/mars_task_queue.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/src/mpu/lib/mars_task_queue.c
+++ b/src/mpu/lib/mars_task_queue.c
@@ -183,11 +183,11 @@ static int push(uint64_t queue_ea, const
 		}
 
 		/* check if push wait list full */
-		MARS_CHECK_CLEANUP_RET(
-			queue.push_wait_count < MARS_TASK_QUEUE_WAIT_MAX,
+		if (queue.push_wait_count == MARS_TASK_QUEUE_WAIT_MAX) {
 			mars_mutex_unlock_put(queue_ea,
-				(struct mars_mutex *)&queue),
-			MARS_ERROR_LIMIT);
+				(struct mars_mutex *)&queue);
+			return MARS_ERROR_LIMIT;
+		}
 
 		/* add id to push wait list */
 		queue.push_wait_id[queue.push_wait_count]
@@ -320,11 +320,11 @@ static int pop(uint64_t queue_ea, void *
 		}
 
 		/* check if pop wait list full */
-		MARS_CHECK_CLEANUP_RET(
-			queue.pop_wait_count < MARS_TASK_QUEUE_WAIT_MAX,
+		if (queue.pop_wait_count == MARS_TASK_QUEUE_WAIT_MAX) {
 			mars_mutex_unlock_put(queue_ea,
-				(struct mars_mutex *)&queue),
-			MARS_ERROR_LIMIT);
+				(struct mars_mutex *)&queue);
+			return MARS_ERROR_LIMIT;
+		}
 
 		/* add id to pop wait list */
 		queue.pop_wait_id[queue.pop_wait_count]





More information about the cbe-oss-dev mailing list