[PATCH 3/3] score: Fix _CORE_message_queue_Submit() indentation

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


This fix relates to a Coverity issue (NESTING_INDENT_MISMATCH).
---
 cpukit/score/src/coremsgsubmit.c | 80 ++++++++++++++++----------------
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/cpukit/score/src/coremsgsubmit.c b/cpukit/score/src/coremsgsubmit.c
index fda000cc86..90f5a5c327 100644
--- a/cpukit/score/src/coremsgsubmit.c
+++ b/cpukit/score/src/coremsgsubmit.c
@@ -99,49 +99,49 @@ Status_Control _CORE_message_queue_Submit(
     return STATUS_SUCCESSFUL;
   }
 
-  #if !defined(RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND)
+#if !defined(RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND)
+  _CORE_message_queue_Release( the_message_queue, queue_context );
+  return STATUS_TOO_MANY;
+#else
+  /*
+   *  No message buffers were available so we may need to return an
+   *  overflow error or block the sender until the message is placed
+   *  on the queue.
+   */
+  if ( !wait ) {
     _CORE_message_queue_Release( the_message_queue, queue_context );
     return STATUS_TOO_MANY;
-  #else
-    /*
-     *  No message buffers were available so we may need to return an
-     *  overflow error or block the sender until the message is placed
-     *  on the queue.
-     */
-    if ( !wait ) {
-      _CORE_message_queue_Release( the_message_queue, queue_context );
-      return STATUS_TOO_MANY;
-    }
+  }
 
-    /*
-     *  Do NOT block on a send if the caller is in an ISR.  It is
-     *  deadly to block in an ISR.
-     */
-    if ( _ISR_Is_in_progress() ) {
-      _CORE_message_queue_Release( the_message_queue, queue_context );
-      return STATUS_MESSAGE_QUEUE_WAIT_IN_ISR;
-    }
+  /*
+   *  Do NOT block on a send if the caller is in an ISR.  It is
+   *  deadly to block in an ISR.
+   */
+  if ( _ISR_Is_in_progress() ) {
+    _CORE_message_queue_Release( the_message_queue, queue_context );
+    return STATUS_MESSAGE_QUEUE_WAIT_IN_ISR;
+  }
 
-    /*
-     *  WARNING!! executing should NOT be used prior to this point.
-     *  Thus the unusual choice to open a new scope and declare
-     *  it as a variable.  Doing this emphasizes how dangerous it
-     *  would be to use this variable prior to here.
-     */
-    executing->Wait.return_argument_second.immutable_object = buffer;
-    executing->Wait.option = (uint32_t) size;
-    executing->Wait.count = submit_type;
+  /*
+   *  WARNING!! executing should NOT be used prior to this point.
+   *  Thus the unusual choice to open a new scope and declare
+   *  it as a variable.  Doing this emphasizes how dangerous it
+   *  would be to use this variable prior to here.
+   */
+  executing->Wait.return_argument_second.immutable_object = buffer;
+  executing->Wait.option = (uint32_t) size;
+  executing->Wait.count = submit_type;
 
-    _Thread_queue_Context_set_thread_state(
-      queue_context,
-      STATES_WAITING_FOR_MESSAGE
-    );
-    _Thread_queue_Enqueue(
-      &the_message_queue->Wait_queue.Queue,
-      the_message_queue->operations,
-      executing,
-      queue_context
-    );
-    return _Thread_Wait_get_status( executing );
-  #endif
+  _Thread_queue_Context_set_thread_state(
+    queue_context,
+    STATES_WAITING_FOR_MESSAGE
+  );
+  _Thread_queue_Enqueue(
+    &the_message_queue->Wait_queue.Queue,
+    the_message_queue->operations,
+    executing,
+    queue_context
+  );
+  return _Thread_Wait_get_status( executing );
+#endif
 }
-- 
2.26.2



More information about the devel mailing list