summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-12 11:19:10 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-12 13:16:03 +0100
commitdac340dd663bdfed29470c1327a2e7d10dbfa002 (patch)
treebd3acfbf94b5617d704bccd07de00179585d6fe0
parentconfdefs.h: Fix workspace size if idle task is FP (diff)
downloadrtems-dac340dd663bdfed29470c1327a2e7d10dbfa002.tar.bz2
posix: Simplify _POSIX_Keys_Find()
-rw-r--r--cpukit/posix/include/rtems/posix/keyimpl.h13
-rw-r--r--cpukit/posix/src/keyfreememory.c3
-rw-r--r--cpukit/posix/src/keygetspecific.c3
-rw-r--r--cpukit/posix/src/keysetspecific.c3
4 files changed, 10 insertions, 12 deletions
diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h
index 42989b0c16..1dcfb4e9c6 100644
--- a/cpukit/posix/include/rtems/posix/keyimpl.h
+++ b/cpukit/posix/include/rtems/posix/keyimpl.h
@@ -169,17 +169,18 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free(
}
RTEMS_INLINE_ROUTINE RBTree_Node *_POSIX_Keys_Find(
- pthread_key_t key,
- Thread_Control *thread,
- POSIX_Keys_Key_value_pair *search_node
+ pthread_key_t key,
+ Thread_Control *thread
)
{
- search_node->key = key;
- search_node->thread = thread;
+ POSIX_Keys_Key_value_pair search_node;
+
+ search_node.key = key;
+ search_node.thread = thread;
return _RBTree_Find(
&_POSIX_Keys_Key_value_lookup_tree,
- &search_node->Key_value_lookup_node,
+ &search_node.Key_value_lookup_node,
_POSIX_Keys_Key_value_compare,
true
);
diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c
index 4e19832827..9f03f6bd7e 100644
--- a/cpukit/posix/src/keyfreememory.c
+++ b/cpukit/posix/src/keyfreememory.c
@@ -26,13 +26,12 @@ void _POSIX_Keys_Free_memory(
POSIX_Keys_Control *the_key
)
{
- POSIX_Keys_Key_value_pair search_node;
POSIX_Keys_Key_value_pair *p;
RBTree_Node *iter, *next;
Objects_Id key_id;
key_id = the_key->Object.id;
- iter = _POSIX_Keys_Find( key_id, 0, &search_node );
+ iter = _POSIX_Keys_Find( key_id, 0 );
if ( !iter )
return;
/**
diff --git a/cpukit/posix/src/keygetspecific.c b/cpukit/posix/src/keygetspecific.c
index 5ab37a7553..ef6c19d56c 100644
--- a/cpukit/posix/src/keygetspecific.c
+++ b/cpukit/posix/src/keygetspecific.c
@@ -40,7 +40,6 @@ void *pthread_getspecific(
{
POSIX_Keys_Control *the_key;
Objects_Locations location;
- POSIX_Keys_Key_value_pair search_node;
RBTree_Node *p;
void *key_data;
POSIX_Keys_Key_value_pair *value_pair_p;
@@ -49,7 +48,7 @@ void *pthread_getspecific(
switch ( location ) {
case OBJECTS_LOCAL:
- p = _POSIX_Keys_Find( key, _Thread_Executing, &search_node );
+ p = _POSIX_Keys_Find( key, _Thread_Executing );
if ( p != NULL ) {
value_pair_p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( p );
key_data = value_pair_p->value;
diff --git a/cpukit/posix/src/keysetspecific.c b/cpukit/posix/src/keysetspecific.c
index 8e4b3a43ca..427fff3d03 100644
--- a/cpukit/posix/src/keysetspecific.c
+++ b/cpukit/posix/src/keysetspecific.c
@@ -38,7 +38,6 @@ int pthread_setspecific(
Objects_Locations location;
POSIX_Keys_Key_value_pair *value_pair_ptr;
RBTree_Node *p;
- POSIX_Keys_Key_value_pair search_node;
Thread_Control *executing;
the_key = _POSIX_Keys_Get( key, &location );
@@ -46,7 +45,7 @@ int pthread_setspecific(
case OBJECTS_LOCAL:
executing = _Thread_Executing;
- p = _POSIX_Keys_Find( key, executing, &search_node );
+ p = _POSIX_Keys_Find( key, executing );
if ( p != NULL ) {
value_pair_ptr = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( p );
value_pair_ptr->value = RTEMS_DECONST( void *, value );