[PATCH 07/11] score: Simplify _CORE_message_queue_Broadcast()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jan 28 15:28:03 UTC 2021


This fix relates to a Coverity issue (PW.SET_BUT_NOT_USED).
---
 cpukit/score/src/coremsgbroadcast.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/cpukit/score/src/coremsgbroadcast.c b/cpukit/score/src/coremsgbroadcast.c
index f119d49275..3d6c94925f 100644
--- a/cpukit/score/src/coremsgbroadcast.c
+++ b/cpukit/score/src/coremsgbroadcast.c
@@ -31,8 +31,7 @@ Status_Control _CORE_message_queue_Broadcast(
   Thread_queue_Context       *queue_context
 )
 {
-  Thread_Control             *the_thread;
-  uint32_t                    number_broadcasted;
+  uint32_t number_broadcasted;
 
   if ( size > the_message_queue->maximum_message_size ) {
     _ISR_lock_ISR_enable( &queue_context->Lock_context.Lock_context );
@@ -44,15 +43,13 @@ Status_Control _CORE_message_queue_Broadcast(
   _CORE_message_queue_Acquire_critical( the_message_queue, queue_context );
 
   while (
-    ( the_thread =
-      _CORE_message_queue_Dequeue_receiver(
-        the_message_queue,
-        buffer,
-        size,
-        0,
-        queue_context
-      )
-    )
+    _CORE_message_queue_Dequeue_receiver(
+      the_message_queue,
+      buffer,
+      size,
+      0,
+      queue_context
+    ) != NULL
   ) {
     number_broadcasted += 1;
 
-- 
2.26.2



More information about the devel mailing list