summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-16 20:34:59 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-06-23 10:28:49 +0200
commit5dffbc424e7aac75e3704418c7d5a8b94cdd5ac8 (patch)
tree350d36d33411afb83abacd0aa9921bfb1966c5ed /cpukit/include/rtems/score
parentkern_tc.c: Provide a weak hardpps() implementation (diff)
downloadrtems-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/include/rtems/score')
-rw-r--r--cpukit/include/rtems/score/priorityimpl.h33
1 files changed, 5 insertions, 28 deletions
diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h
index 1463bf6c2a..55cddf53be 100644
--- a/cpukit/include/rtems/score/priorityimpl.h
+++ b/cpukit/include/rtems/score/priorityimpl.h
@@ -125,26 +125,6 @@ RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty(
}
/**
- * @brief Checks if the priority actions is valid.
- *
- * @param aggregation The aggregation of the priority action.
- *
- * @retval true The @a aggregation is valid.
- * @retval false The @a aggregation is not valid.
- */
-RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_valid(
- const Priority_Aggregation *aggregation
-)
-{
-#if defined(RTEMS_SMP)
- return aggregation != NULL;
-#else
- (void) aggregation;
- return false;
-#endif
-}
-
-/**
* @brief Moves the priority actions' actions.
*
* @param[in, out] actions The priority actions to move the actions away from.
@@ -389,25 +369,22 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action(
aggregation->Action.type = type;
}
+#if defined(RTEMS_SMP)
/**
* @brief Gets the next action of the priority aggregation.
*
- * @param aggregation The priority aggregation to get the next action of.
+ * @param aggregation is the priority aggregation to get the next action of.
*
- * @retval next_action The next action of @a aggregation if RTEMS_SMP is defined.
- * @retval NULL RTEMS_SMP is not defined.
+ * @return Returns the next action of the priority aggregation or NULL if there
+ * is no next action.
*/
RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Get_next_action(
const Priority_Aggregation *aggregation
)
{
-#if defined(RTEMS_SMP)
return aggregation->Action.next;
-#else
- (void) aggregation;
- return NULL;
-#endif
}
+#endif
/**
* @brief Compares two priorities.