[rtems commit] Remove superfluous run-time check

Sebastian Huber sebh at rtems.org
Tue Apr 9 05:32:13 UTC 2019


Module:    rtems
Branch:    master
Commit:    e0dcf294382b4b9f2402d9f42813468dfdbf7b18
Changeset: http://git.rtems.org/rtems/commit/?id=e0dcf294382b4b9f2402d9f42813468dfdbf7b18

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Apr  5 09:58:07 2019 +0200

Remove superfluous run-time check

The _Objects_Information_table[ the_api ] is never NULL for a valid API
index.

---

 cpukit/posix/src/killinfo.c      | 8 +-------
 cpukit/score/src/threaditerate.c | 5 +----
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c
index 0031b7b..742f9fb 100644
--- a/cpukit/posix/src/killinfo.c
+++ b/cpukit/posix/src/killinfo.c
@@ -196,13 +196,7 @@ int _POSIX_signals_Send(
   interested_priority = UINT64_MAX;
 
   for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
-
-    /*
-     *  This can occur when no one is interested and an API is not configured.
-     */
-    if ( !_Objects_Information_table[ the_api ] )
-      continue;
-
+    _Assert( _Objects_Information_table[ the_api ] != NULL );
     the_info = _Objects_Information_table[ the_api ][ 1 ];
     if ( !the_info )
       continue;
diff --git a/cpukit/score/src/threaditerate.c b/cpukit/score/src/threaditerate.c
index 8d1614a..78ccb67 100644
--- a/cpukit/score/src/threaditerate.c
+++ b/cpukit/score/src/threaditerate.c
@@ -30,10 +30,7 @@ void _Thread_Iterate(
     Objects_Maximum            maximum;
     Objects_Maximum            index;
 
-    if ( _Objects_Information_table[ api_index ] == NULL ) {
-      continue;
-    }
-
+    _Assert( _Objects_Information_table[ api_index ] != NULL );
     information = _Objects_Information_table[ api_index ][ 1 ];
 
     if ( information == NULL ) {




More information about the vc mailing list