[PATCH] score: Use only next field for chain on/off

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Mar 14 12:56:41 UTC 2014


It is sufficient to use one field for the chain on/off indication.  The
chain API functions are highly performance critical.
---
 cpukit/score/include/rtems/score/chainimpl.h |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpukit/score/include/rtems/score/chainimpl.h b/cpukit/score/include/rtems/score/chainimpl.h
index 98416b2..1a7ee5d 100644
--- a/cpukit/score/include/rtems/score/chainimpl.h
+++ b/cpukit/score/include/rtems/score/chainimpl.h
@@ -221,8 +221,8 @@ size_t _Chain_Node_count_unprotected( const Chain_Control *chain );
 /**
  * @brief Set off chain.
  *
- * This function sets the next and previous fields of the @a node to NULL
- * indicating the @a node is not part of a chain.
+ * This function sets the next field of the @a node to NULL indicating the @a
+ * node is not part of a chain.
  *
  * @param[in] node the node set to off chain.
  */
@@ -230,14 +230,14 @@ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
   Chain_Node *node
 )
 {
-  node->next = node->previous = NULL;
+  node->next = NULL;
 }
 
 /**
  * @brief Is the node off chain.
  *
- * This function returns true if the @a node is not on a chain. A @a node is
- * off chain if the next and previous fields are set to NULL.
+ * This function returns true if the @a node is not on a chain.  A @a node is
+ * off chain if the next field is set to NULL.
  *
  * @param[in] node is the node off chain.
  *
@@ -248,7 +248,7 @@ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
   const Chain_Node *node
 )
 {
-  return (node->next == NULL) && (node->previous == NULL);
+  return node->next == NULL;
 }
 
 /**
-- 
1.7.7




More information about the devel mailing list