[PATCH 03/20] score: Simplify _CORE_message_queue_Close()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Apr 19 13:12:31 UTC 2016


Drop status parameter since each caller used
CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED.

Remove superfluous _CORE_message_queue_Flush().
---
 cpukit/posix/src/mqueuedeletesupp.c            |  1 -
 cpukit/rtems/src/msgqdelete.c                  |  1 -
 cpukit/score/include/rtems/score/coremsgimpl.h | 11 ++---------
 cpukit/score/src/coremsgclose.c                |  5 ++---
 4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/cpukit/posix/src/mqueuedeletesupp.c b/cpukit/posix/src/mqueuedeletesupp.c
index 30b8b7d..b852b04 100644
--- a/cpukit/posix/src/mqueuedeletesupp.c
+++ b/cpukit/posix/src/mqueuedeletesupp.c
@@ -59,7 +59,6 @@ void _POSIX_Message_queue_Delete(
 
       _CORE_message_queue_Close(
         &the_mq->Message_queue,
-        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
         NULL,        /* no MP support */
         0
       );
diff --git a/cpukit/rtems/src/msgqdelete.c b/cpukit/rtems/src/msgqdelete.c
index d6e773d..5adeab7 100644
--- a/cpukit/rtems/src/msgqdelete.c
+++ b/cpukit/rtems/src/msgqdelete.c
@@ -47,7 +47,6 @@ rtems_status_code rtems_message_queue_delete(
 
       _CORE_message_queue_Close(
         &the_message_queue->message_queue,
-        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
         _Message_queue_MP_Send_object_was_deleted,
         id
       );
diff --git a/cpukit/score/include/rtems/score/coremsgimpl.h b/cpukit/score/include/rtems/score/coremsgimpl.h
index d7d5c46..98d97dd 100644
--- a/cpukit/score/include/rtems/score/coremsgimpl.h
+++ b/cpukit/score/include/rtems/score/coremsgimpl.h
@@ -129,8 +129,7 @@ bool _CORE_message_queue_Initialize(
 );
 
 void _CORE_message_queue_Do_close(
-  CORE_message_queue_Control *the_message_queue,
-  uint32_t                    status
+  CORE_message_queue_Control *the_message_queue
 #if defined(RTEMS_MULTIPROCESSING)
   ,
   Thread_queue_MP_callout     mp_callout,
@@ -149,8 +148,6 @@ void _CORE_message_queue_Do_close(
  *  flushing @a the_message_queue's task wait queue.
  *
  *  @param[in] the_message_queue points to the message queue to close
- *  @param[in] status is the status that each waiting thread will return
- *         from it's blocking service
  *  @param[in] mp_callout is the routine to call for each thread
  *         that is extracted from the set of waiting threads
  *  @param[in] mp_id the object identifier of the message queue object
@@ -158,26 +155,22 @@ void _CORE_message_queue_Do_close(
 #if defined(RTEMS_MULTIPROCESSING)
   #define _CORE_message_queue_Close( \
     the_message_queue, \
-    status, \
     mp_callout, \
     mp_id \
   ) \
     _CORE_message_queue_Do_close( \
       the_message_queue, \
-      status, \
       mp_callout, \
       mp_id \
     )
 #else
   #define _CORE_message_queue_Close( \
     the_message_queue, \
-    status, \
     mp_callout, \
     mp_id \
   ) \
     _CORE_message_queue_Do_close( \
-      the_message_queue, \
-      status \
+      the_message_queue \
     )
 #endif
 
diff --git a/cpukit/score/src/coremsgclose.c b/cpukit/score/src/coremsgclose.c
index e070d98..1511f83 100644
--- a/cpukit/score/src/coremsgclose.c
+++ b/cpukit/score/src/coremsgclose.c
@@ -22,8 +22,7 @@
 #include <rtems/score/wkspace.h>
 
 void _CORE_message_queue_Do_close(
-  CORE_message_queue_Control *the_message_queue,
-  uint32_t                    status
+  CORE_message_queue_Control *the_message_queue
 #if defined(RTEMS_MULTIPROCESSING)
   ,
   Thread_queue_MP_callout     mp_callout,
@@ -39,7 +38,7 @@ void _CORE_message_queue_Do_close(
   _Thread_queue_Flush(
     &the_message_queue->Wait_queue,
     the_message_queue->operations,
-    status,
+    CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED,
     mp_callout,
     mp_id
   );
-- 
1.8.4.5




More information about the devel mailing list