jingfei195887 opened a new pull request, #21666:
URL: https://github.com/apache/nuttx/pull/21666
## Summary
`uio_resid` is a `size_t`, so `DEBUGASSERT(uio->uio_resid >= 0)` in
`uio_copyfrom()` and `uio_copyto()` is always true and is flagged by
static analysis. `uio_init()` already rejects a negative residual before
storing it, and the remaining asserts still check the upper bounds.
The second commit adds the blank line after the declarations that
nxstyle requires in the same two functions, so the file passes
`checkpatch.sh`.
## Impact
No functional change.
## Testing
Host: Ubuntu x86_64, gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, master
03aea78639, `sim:nsh` with
`CONFIG_DEBUG_ASSERTIONS=y`.
- `objdump -d fs/fs_uio.o` matches master except for the line numbers
passed to the assert handler, which shift by one after the removed
lines.
- `./tools/checkpatch.sh -g master..HEAD`: all checks pass.
- Make and CMake builds pass; `ostest` exits with status 0.
--
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]