[PATCH] score: Simplify _Objects_Is_api_valid()

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Mar 23 15:39:55 UTC 2023


Close #4863.
---
 cpukit/include/rtems/score/objectimpl.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/cpukit/include/rtems/score/objectimpl.h b/cpukit/include/rtems/score/objectimpl.h
index c58957ccb5..a1a87b5ccb 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -542,9 +542,7 @@ static inline bool _Objects_Is_api_valid(
   uint32_t   the_api
 )
 {
-  if ( !the_api || the_api > OBJECTS_APIS_LAST )
-   return false;
-  return true;
+  return ( 1 <= the_api && the_api <= OBJECTS_APIS_LAST );
 }
 
 /**
-- 
2.35.3



More information about the devel mailing list