summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cpukit/ChangeLog4
-rw-r--r--cpukit/score/src/objectgetinfo.c13
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 ] )