On 23.03.23 17:03, Joel Sherrill wrote:
On Thu, Mar 23, 2023 at 10:40 AM Sebastian Huber <[email protected] <mailto:[email protected]>> wrote: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 ); } I'd really prefer we avoid compound logical expressions since it becomes something that needs MCDC analysis at higher levels of verification/qualification.
How does this simplify MC/DC analysis? The truth table doesn't change if I replace a short-circuit boolean expression with if + return.
Please rewrite using simple logical expressions even if it means two exit paths at the source leve. It's the same machine code.
Yes. -- embedded brains GmbH Herr Sebastian HUBER Dornierstr. 4 82178 Puchheim Germany email: [email protected] phone: +49-89-18 94 741 - 16 fax: +49-89-18 94 741 - 08 Registergericht: Amtsgericht München Registernummer: HRB 157899 Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler Unsere Datenschutzerklärung finden Sie hier: https://embedded-brains.de/datenschutzerklaerung/ _______________________________________________ devel mailing list [email protected] http://lists.rtems.org/mailman/listinfo/devel
