diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-25 20:15:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:02 +0100 |
commit | 1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98 (patch) | |
tree | ff95b47443c47377f1e9bcb7790cffb4b6e59bb0 /cpukit/score/src/objectgetnext.c | |
parent | 3899bc1a4b3294306ae2fd3f8ff0ee10365d9f4b (diff) |
score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id.
Add and use _Objects_Get_maximum_index().
Update #3621.
Diffstat (limited to 'cpukit/score/src/objectgetnext.c')
-rw-r--r-- | cpukit/score/src/objectgetnext.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/cpukit/score/src/objectgetnext.c b/cpukit/score/src/objectgetnext.c index 054ed22fc1..156bee72a4 100644 --- a/cpukit/score/src/objectgetnext.c +++ b/cpukit/score/src/objectgetnext.c @@ -28,6 +28,7 @@ Objects_Control *_Objects_Get_next( { Objects_Control *the_object; Objects_Id next_id; + Objects_Maximum maximum; if ( !information ) return NULL; @@ -41,21 +42,20 @@ Objects_Control *_Objects_Get_next( next_id = id; _Objects_Allocator_lock(); + maximum = _Objects_Get_maximum_index( information ); do { - /* walked off end of list? */ - if (_Objects_Get_index(next_id) > information->maximum) - { - _Objects_Allocator_unlock(); - *next_id_p = OBJECTS_ID_FINAL; - return NULL; - } + /* walked off end of list? */ + if (_Objects_Get_index( next_id ) > maximum) { + _Objects_Allocator_unlock(); + *next_id_p = OBJECTS_ID_FINAL; + return NULL; + } - /* try to grab one */ - the_object = _Objects_Get_no_protection( next_id, information ); - - next_id++; + /* try to grab one */ + the_object = _Objects_Get_no_protection( next_id, information ); + next_id++; } while ( the_object == NULL ); *next_id_p = next_id; |