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

Sebastian Huber sebh at rtems.org
Mon Mar 17 08:10:34 UTC 2014


Module:    rtems
Branch:    master
Commit:    d6da1b1ef4bf83faa6cc15d3ca7bf0c8b8e80508
Changeset: http://git.rtems.org/rtems/commit/?id=d6da1b1ef4bf83faa6cc15d3ca7bf0c8b8e80508

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Mar 14 13:55:00 2014 +0100

score: Use only next field for chain on/off

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;
 }
 
 /**




More information about the vc mailing list