diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-08 17:56:07 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-08 17:56:07 +0000 |
commit | 4b4108a4c5632255989b1379e70221d011018ee4 (patch) | |
tree | 0beecb89145e9cdada43c48e666c4e04fbd35871 /cpukit | |
parent | 2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-4b4108a4c5632255989b1379e70221d011018ee4.tar.bz2 |
2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/objectgetinfo.c: Clean up and eliminate unreachable code.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 4 | ||||
-rw-r--r-- | cpukit/score/src/objectgetinfo.c | 13 |
2 files changed, 12 insertions, 5 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index f86c69d4a1..c34ce76932 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,7 @@ +2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> + + * score/src/objectgetinfo.c: Clean up and eliminate unreachable code. + 2009-07-07 Joel Sherrill <joel.sherrill@oarcorp.com> * rtems/src/rtemsobjectapimaximumclass.c, diff --git a/cpukit/score/src/objectgetinfo.c b/cpukit/score/src/objectgetinfo.c index dd8e84a7da..9207af8f90 100644 --- a/cpukit/score/src/objectgetinfo.c +++ b/cpukit/score/src/objectgetinfo.c @@ -26,15 +26,18 @@ Objects_Information *_Objects_Get_information( Objects_Information *info; int the_class_api_maximum; - if ( !_Objects_Is_api_valid( the_api ) ) - return NULL; - if ( !the_class ) return NULL; + /* + * This call implicitly validates the_api so we do not call + * _Objects_Is_api_valid above here. + */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); - if ( the_class_api_maximum == 0 || - the_class > (uint32_t) the_class_api_maximum ) + if ( the_class_api_maximum == 0 ) + return NULL; + + if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) |