fxysunshine opened a new pull request, #18016:
URL: https://github.com/apache/nuttx/pull/18016

   ### Summary
   This PR addresses a small set of MISRA C:2012 and Coverity findings across 
NuttX core code.
   The changes are focused on type-safety, initialization, and simplifying 
return paths without altering intended behavior.
   
   Key updates:
   - Fix MISRA Rule 10.4 by using the proper enum type for `g_nx_initstate`.
   - Fix MISRA Rule 10.3 in ARMv8-R IRQ helpers by using unsigned constants 
(`1u`, `~1u`) for bit operations.
   - Fix a Coverity uninitialized-field report by zero-initializing 
`posix_spawnattr_t` in `posix_spawnattr_init()`.
   - Refactor several scheduler/task helpers to use a single return path 
(Coverity “RETURN” metric), improving readability and reducing early returns.
   
   ### Impact
   - **Functional impact:** No intended functional change; these are 
compliance/quality fixes (type correctness, initialization, control-flow 
cleanup).
   - **Affected areas:**
     - Scheduler/task utilities (`sched/task/*`)
     - System init state (`include/nuttx/init.h`, `sched/init/nx_start.c`)
     - libc spawn attributes (`libs/libc/spawn/lib_psa_init.c`)
     - ARMv8-R IRQ helpers (`arch/arm/include/armv8-r/irq.h`)
   - **Risk:** Low. Changes are localized and primarily mechanical (types, 
constants, return-path refactors).
   
   ### Testing
   - **Environment:**
     - Host: Linux
     - Build system: CMake
     - Configurations:
     - sim:nsh and qemu-armv7a:nsh
   - **Steps:**
   1. Configure and build sim:nsh (CMake):
       - ./tools/configure.sh -c sim:nsh
       - cmake -B build -S .
       - cmake --build build -j
   2. Configure and build qemu-armv7a:nsh (CMake):
       - ./tools/configure.sh -c qemu-armv7a:nsh
       - cmake -B build -S .
       - cmake --build build -j
   3. Boot and run NSH smoke checks:
       - Run help
       - Run ps ...
   
   - **Results:**
       - MISRA/Coverity: PASS (no new issues introduced; targeted findings 
addressed)
       - sim:nsh (CMake): PASS (build + NSH smoke)
       - qemu-armv7a:nsh (CMake): PASS (build + NSH smoke)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to