diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-05-16 20:34:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-06-23 10:28:49 +0200 |
commit | 5dffbc424e7aac75e3704418c7d5a8b94cdd5ac8 (patch) | |
tree | 350d36d33411afb83abacd0aa9921bfb1966c5ed /cpukit/score/src/threadqops.c | |
parent | kern_tc.c: Provide a weak hardpps() implementation (diff) | |
download | rtems-5dffbc424e7aac75e3704418c7d5a8b94cdd5ac8.tar.bz2 |
score: Make SMP only code explicit
Conditional expressions with inline functions are not optimized away if
optimization is disabled. Avoid such expressions to prevent dead
branches. It helps also during code review to immediately see if a loop
is used or not.
Diffstat (limited to 'cpukit/score/src/threadqops.c')
-rw-r--r-- | cpukit/score/src/threadqops.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/score/src/threadqops.c b/cpukit/score/src/threadqops.c index 33fc5a44cb..fbea9f6de6 100644 --- a/cpukit/score/src/threadqops.c +++ b/cpukit/score/src/threadqops.c @@ -404,8 +404,12 @@ static void _Thread_queue_Priority_priority_actions( break; } +#if defined(RTEMS_SMP) priority_aggregation = _Priority_Get_next_action( priority_aggregation ); - } while ( _Priority_Actions_is_valid( priority_aggregation ) ); + } while ( priority_aggregation != NULL ); +#else + } while ( false ); +#endif } static void _Thread_queue_Priority_do_initialize( @@ -734,14 +738,18 @@ static void _Thread_queue_Priority_inherit_priority_actions( priority_aggregation = _Priority_Actions_move( priority_actions ); do { +#if defined(RTEMS_SMP) Priority_Aggregation *next_aggregation; +#endif Scheduler_Node *scheduler_node; size_t scheduler_index; Thread_queue_Priority_queue *priority_queue; Scheduler_Node *scheduler_node_of_owner; Priority_Action_type priority_action_type; +#if defined(RTEMS_SMP) next_aggregation = _Priority_Get_next_action( priority_aggregation ); +#endif scheduler_node = SCHEDULER_NODE_OF_WAIT_PRIORITY( priority_aggregation ); scheduler_index = _Thread_queue_Scheduler_index( scheduler_node ); @@ -797,8 +805,12 @@ static void _Thread_queue_Priority_inherit_priority_actions( break; } +#if defined(RTEMS_SMP) priority_aggregation = next_aggregation; - } while ( _Priority_Actions_is_valid( priority_aggregation ) ); + } while ( priority_aggregation != NULL ); +#else + } while ( false ); +#endif } static void _Thread_queue_Priority_inherit_do_initialize( |