summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-03 09:24:32 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-04 07:24:30 +0200
commit8c77150b39da2d5358de1e65437e00a1611635f8 (patch)
tree4d608cbbc560d22a828e9ef640863809e7fb939b /cpukit/score
parentscore: Make _Objects_Information_table const (diff)
downloadrtems-8c77150b39da2d5358de1e65437e00a1611635f8.tar.bz2
score: Simplify _Thread_Get_objects_information()
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/src/threadget.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpukit/score/src/threadget.c b/cpukit/score/src/threadget.c
index 8731ab5d43..24773facbf 100644
--- a/cpukit/score/src/threadget.c
+++ b/cpukit/score/src/threadget.c
@@ -25,20 +25,21 @@ static Objects_Information *_Thread_Get_objects_information(
Objects_Id id
)
{
- uint32_t the_api;
- uint32_t the_class;
+ uint32_t the_api;
the_api = _Objects_Get_API( id );
- if ( !_Objects_Is_api_valid( the_api ) ) {
- return NULL;
- }
- the_class = _Objects_Get_class( id );
- if ( the_class != 1 ) { /* threads are always first class :) */
+ if ( !_Objects_Is_api_valid( the_api ) ) {
return NULL;
}
- return _Objects_Information_table[ the_api ][ the_class ];
+ /*
+ * Threads are always first class :)
+ *
+ * There is no need to validate the object class of the object identifier,
+ * since this will be done by the object get methods.
+ */
+ return _Objects_Information_table[ the_api ][ 1 ];
}
Thread_Control *_Thread_Get(