diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-03 09:19:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-04 07:24:30 +0200 |
commit | 876dde7a7dc5c44952bea8503b5a45ebf7f5591c (patch) | |
tree | d631ffd578e1d9917601b7118e091e0eceb8b56b /cpukit/score | |
parent | score: Simplify _Objects_Id_to_name() (diff) | |
download | rtems-876dde7a7dc5c44952bea8503b5a45ebf7f5591c.tar.bz2 |
score: Make _Objects_Information_table const
The _Objects_Information_table is statically initialized. So, we can
make it read-only.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/objectimpl.h | 4 | ||||
-rw-r--r-- | cpukit/score/src/threadget.c | 14 |
2 files changed, 3 insertions, 15 deletions
diff --git a/cpukit/score/include/rtems/score/objectimpl.h b/cpukit/score/include/rtems/score/objectimpl.h index 1129daf32f..fe087719b7 100644 --- a/cpukit/score/include/rtems/score/objectimpl.h +++ b/cpukit/score/include/rtems/score/objectimpl.h @@ -213,8 +213,8 @@ extern uint16_t _Objects_Maximum_nodes; * class. From the ID, we can go to one of these information blocks, * and obtain a pointer to the appropriate object control block. */ -extern Objects_Information - **_Objects_Information_table[OBJECTS_APIS_LAST + 1]; +extern Objects_Information ** const +_Objects_Information_table[ OBJECTS_APIS_LAST + 1 ]; /** * This function extends an object class information record. diff --git a/cpukit/score/src/threadget.c b/cpukit/score/src/threadget.c index 45ea55f719..8731ab5d43 100644 --- a/cpukit/score/src/threadget.c +++ b/cpukit/score/src/threadget.c @@ -27,7 +27,6 @@ static Objects_Information *_Thread_Get_objects_information( { uint32_t the_api; uint32_t the_class; - Objects_Information **api_information; the_api = _Objects_Get_API( id ); if ( !_Objects_Is_api_valid( the_api ) ) { @@ -39,18 +38,7 @@ static Objects_Information *_Thread_Get_objects_information( return NULL; } - api_information = _Objects_Information_table[ the_api ]; - /* - * There is no way for this to happen if POSIX is enabled. But there - * is actually a test case in sp43 for this which trips it whether or - * not POSIX is enabled. So in the interest of safety, this is left - * on in all configurations. - */ - if ( !api_information ) { - return NULL; - } - - return api_information[ the_class ]; + return _Objects_Information_table[ the_api ][ the_class ]; } Thread_Control *_Thread_Get( |