summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectgetinfo.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-08 17:56:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-07-08 17:56:07 +0000
commit4b4108a4c5632255989b1379e70221d011018ee4 (patch)
tree0beecb89145e9cdada43c48e666c4e04fbd35871 /cpukit/score/src/objectgetinfo.c
parent2009-07-08 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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/score/src/objectgetinfo.c')
-rw-r--r--cpukit/score/src/objectgetinfo.c13
1 files changed, 8 insertions, 5 deletions
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 ] )