[PATCH 10/27] score: Remove return value from enqueue scheduled

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Nov 15 17:12:42 UTC 2021


The return value was unused.  Remove it.

Update #4531.
---
 cpukit/include/rtems/score/schedulersmpimpl.h | 56 ++++++++++---------
 cpukit/score/src/scheduleredfsmp.c            |  4 +-
 .../score/src/schedulerpriorityaffinitysmp.c  |  4 +-
 cpukit/score/src/schedulerprioritysmp.c       |  4 +-
 cpukit/score/src/schedulersimplesmp.c         |  4 +-
 cpukit/score/src/schedulerstrongapa.c         |  4 +-
 6 files changed, 40 insertions(+), 36 deletions(-)

diff --git a/cpukit/include/rtems/score/schedulersmpimpl.h b/cpukit/include/rtems/score/schedulersmpimpl.h
index a93bb508f9..d7c08116b6 100644
--- a/cpukit/include/rtems/score/schedulersmpimpl.h
+++ b/cpukit/include/rtems/score/schedulersmpimpl.h
@@ -330,6 +330,12 @@ typedef bool ( *Scheduler_SMP_Enqueue )(
   Priority_Control   priority
 );
 
+typedef void ( *Scheduler_SMP_Enqueue_scheduled )(
+  Scheduler_Context *context,
+  Scheduler_Node    *node_to_enqueue,
+  Priority_Control   priority
+);
+
 typedef void ( *Scheduler_SMP_Allocate_processor )(
   Scheduler_Context *context,
   Scheduler_Node    *scheduled,
@@ -924,7 +930,7 @@ static inline bool _Scheduler_SMP_Enqueue(
  * @param allocate_processor Function to allocate a processor to a node
  *   based on the rules of the scheduler.
  */
-static inline bool _Scheduler_SMP_Enqueue_scheduled(
+static inline void _Scheduler_SMP_Enqueue_scheduled(
   Scheduler_Context                *context,
   Scheduler_Node                   *const node,
   Priority_Control                  insert_priority,
@@ -977,7 +983,7 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
         _Thread_Scheduler_release_critical( owner, &lock_context );
       }
 
-      return false;
+      return;
     }
 
     action = _Scheduler_Try_to_schedule_node(
@@ -988,8 +994,6 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
     );
 
     if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_SCHEDULE ) {
-      Thread_Control *idle;
-
       _Scheduler_SMP_Preempt(
         context,
         highest_ready,
@@ -1000,12 +1004,12 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
       ( *move_from_ready_to_scheduled )( context, highest_ready );
       ( *insert_ready )( context, node, insert_priority );
 
-      idle = _Scheduler_Release_idle_thread(
+      _Scheduler_Release_idle_thread(
         context,
         node,
         _Scheduler_SMP_Release_idle_thread
       );
-      return ( idle == NULL );
+      return;
     } else if ( action == SCHEDULER_TRY_TO_SCHEDULE_DO_IDLE_EXCHANGE ) {
       _Scheduler_SMP_Node_change_state( node, SCHEDULER_SMP_NODE_READY );
       _Scheduler_SMP_Node_change_state(
@@ -1017,7 +1021,7 @@ static inline bool _Scheduler_SMP_Enqueue_scheduled(
       ( *insert_ready )( context, node, insert_priority );
 
       _Scheduler_Exchange_idle_thread( highest_ready, node );
-      return false;
+      return;
     } else {
       _Assert( action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK );
 
@@ -1333,14 +1337,14 @@ static inline void _Scheduler_SMP_Unblock(
  * @param ask_for_help Function to perform a help request.
  */
 static inline void _Scheduler_SMP_Update_priority(
-  Scheduler_Context          *context,
-  Thread_Control             *thread,
-  Scheduler_Node             *node,
-  Scheduler_SMP_Extract       extract_from_ready,
-  Scheduler_SMP_Update        update,
-  Scheduler_SMP_Enqueue       enqueue,
-  Scheduler_SMP_Enqueue       enqueue_scheduled,
-  Scheduler_SMP_Ask_for_help  ask_for_help
+  Scheduler_Context              *context,
+  Thread_Control                 *thread,
+  Scheduler_Node                 *node,
+  Scheduler_SMP_Extract           extract_from_ready,
+  Scheduler_SMP_Update            update,
+  Scheduler_SMP_Enqueue           enqueue,
+  Scheduler_SMP_Enqueue_scheduled enqueue_scheduled,
+  Scheduler_SMP_Ask_for_help      ask_for_help
 )
 {
   Priority_Control         priority;
@@ -1389,12 +1393,12 @@ static inline void _Scheduler_SMP_Update_priority(
  * @param enqueue_scheduled Function to enqueue a scheduled node.
  */
 static inline void _Scheduler_SMP_Yield(
-  Scheduler_Context     *context,
-  Thread_Control        *thread,
-  Scheduler_Node        *node,
-  Scheduler_SMP_Extract  extract_from_ready,
-  Scheduler_SMP_Enqueue  enqueue,
-  Scheduler_SMP_Enqueue  enqueue_scheduled
+  Scheduler_Context              *context,
+  Thread_Control                 *thread,
+  Scheduler_Node                 *node,
+  Scheduler_SMP_Extract           extract_from_ready,
+  Scheduler_SMP_Enqueue           enqueue,
+  Scheduler_SMP_Enqueue_scheduled enqueue_scheduled
 )
 {
   bool                     needs_help;
@@ -1695,11 +1699,11 @@ static inline void _Scheduler_SMP_Do_start_idle(
  * @param register_idle Function to register the idle thread for a cpu.
  */
 static inline void _Scheduler_SMP_Add_processor(
-  Scheduler_Context           *context,
-  Thread_Control              *idle,
-  Scheduler_SMP_Has_ready      has_ready,
-  Scheduler_SMP_Enqueue        enqueue_scheduled,
-  Scheduler_SMP_Register_idle  register_idle
+  Scheduler_Context              *context,
+  Thread_Control                 *idle,
+  Scheduler_SMP_Has_ready         has_ready,
+  Scheduler_SMP_Enqueue_scheduled enqueue_scheduled,
+  Scheduler_SMP_Register_idle     register_idle
 )
 {
   Scheduler_SMP_Context *self;
diff --git a/cpukit/score/src/scheduleredfsmp.c b/cpukit/score/src/scheduleredfsmp.c
index 13d512118e..8b0467e893 100644
--- a/cpukit/score/src/scheduleredfsmp.c
+++ b/cpukit/score/src/scheduleredfsmp.c
@@ -461,13 +461,13 @@ static inline bool _Scheduler_EDF_SMP_Enqueue(
   );
 }
 
-static inline bool _Scheduler_EDF_SMP_Enqueue_scheduled(
+static inline void _Scheduler_EDF_SMP_Enqueue_scheduled(
   Scheduler_Context *context,
   Scheduler_Node    *node,
   Priority_Control   insert_priority
 )
 {
-  return _Scheduler_SMP_Enqueue_scheduled(
+  _Scheduler_SMP_Enqueue_scheduled(
     context,
     node,
     insert_priority,
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 10f6808a75..b328fae590 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -398,13 +398,13 @@ static bool _Scheduler_priority_affinity_SMP_Enqueue(
  * invoke _Scheduler_SMP_Enqueue_scheduled() with
  * this scheduler's get_highest_ready() helper.
  */
-static bool _Scheduler_priority_affinity_SMP_Enqueue_scheduled(
+static void _Scheduler_priority_affinity_SMP_Enqueue_scheduled(
   Scheduler_Context *context,
   Scheduler_Node    *node,
   Priority_Control   insert_priority
 )
 {
-  return _Scheduler_SMP_Enqueue_scheduled(
+  _Scheduler_SMP_Enqueue_scheduled(
     context,
     node,
     insert_priority,
diff --git a/cpukit/score/src/schedulerprioritysmp.c b/cpukit/score/src/schedulerprioritysmp.c
index d6f8715e01..99eb52bf86 100644
--- a/cpukit/score/src/schedulerprioritysmp.c
+++ b/cpukit/score/src/schedulerprioritysmp.c
@@ -139,13 +139,13 @@ static bool _Scheduler_priority_SMP_Enqueue(
   );
 }
 
-static bool _Scheduler_priority_SMP_Enqueue_scheduled(
+static void _Scheduler_priority_SMP_Enqueue_scheduled(
   Scheduler_Context *context,
   Scheduler_Node    *node,
   Priority_Control   insert_priority
 )
 {
-  return _Scheduler_SMP_Enqueue_scheduled(
+  _Scheduler_SMP_Enqueue_scheduled(
     context,
     node,
     insert_priority,
diff --git a/cpukit/score/src/schedulersimplesmp.c b/cpukit/score/src/schedulersimplesmp.c
index bcb686bdd2..efc71dce84 100644
--- a/cpukit/score/src/schedulersimplesmp.c
+++ b/cpukit/score/src/schedulersimplesmp.c
@@ -209,13 +209,13 @@ static bool _Scheduler_simple_SMP_Enqueue(
   );
 }
 
-static bool _Scheduler_simple_SMP_Enqueue_scheduled(
+static void _Scheduler_simple_SMP_Enqueue_scheduled(
   Scheduler_Context *context,
   Scheduler_Node    *node,
   Priority_Control   insert_priority
 )
 {
-  return _Scheduler_SMP_Enqueue_scheduled(
+  _Scheduler_SMP_Enqueue_scheduled(
     context,
     node,
     insert_priority,
diff --git a/cpukit/score/src/schedulerstrongapa.c b/cpukit/score/src/schedulerstrongapa.c
index 2d138bc7c3..6643005288 100644
--- a/cpukit/score/src/schedulerstrongapa.c
+++ b/cpukit/score/src/schedulerstrongapa.c
@@ -737,13 +737,13 @@ static inline bool _Scheduler_strong_APA_Enqueue(
          );
 }
 
-static inline bool _Scheduler_strong_APA_Enqueue_scheduled(
+static inline void _Scheduler_strong_APA_Enqueue_scheduled(
   Scheduler_Context *context,
   Scheduler_Node    *node,
   Priority_Control   insert_priority
 )
 {
-  return _Scheduler_SMP_Enqueue_scheduled(
+  _Scheduler_SMP_Enqueue_scheduled(
     context,
     node,
     insert_priority,
-- 
2.26.2



More information about the devel mailing list