jingfei195887 opened a new pull request, #21891:
URL: https://github.com/apache/nuttx/pull/21891
## Summary
- **procfs: remove redundant preprocessor guards duplicating build system.**
`fs/Makefile` only includes `procfs/Make.defs` when
`CONFIG_DISABLE_MOUNTPOINT` is not set, and both `procfs/Make.defs` and
`procfs/CMakeLists.txt` only build the procfs sources when
`CONFIG_FS_PROCFS` is set. The whole-file
`#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS)`
guards in `fs_procfscpuload.c`, `fs_procfsproc.c`, `fs_procfstcbinfo.c`,
`fs_procfsuptime.c`, `fs_procfsutil.c` and `fs_procfsversion.c` repeat
that check, so remove them. The inner guards that the build system does
not check (`CONFIG_FS_PROCFS_EXCLUDE_xxx`, `CONFIG_ARCH_HAVE_TCBINFO`)
stay. The `#endif` comments in `fs_procfsuptime.c` and
`fs_procfsversion.c` named `EXCLUDE_PROCESS`; they now name
`EXCLUDE_UPTIME` and `EXCLUDE_VERSION`.
- **fs/procfs: Fix nxstyle errors.** `fs_procfsutil.c` had a missing blank
line after the declarations in `procfs_snprintf()`. Fixed in a separate
commit, as the file is touched by this PR.
## Impact
- New feature / API change: NO.
- Behavior: no functional change; the same code is compiled in the same
configurations.
- Build, hardware, documentation, security, compatibility: NO.
## Testing
Host: Ubuntu x86_64, gcc (Ubuntu 13.1.0-8ubuntu1~22.04) 13.1.0, master
4bf334e462.
- `./tools/checkpatch.sh -g master..HEAD` and `checkpatch.sh -f` on the six
files: all checks pass.
- `sim:nsh` (procfs enabled) Make and CMake builds pass with no new
warnings; `ostest` exits with status 0. Each commit builds on its own.
- Verified on sim only.
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing Guidelines and Documentation (git commit
title and message, coding standard, etc).
* [ ] My PR is still work in progress (not ready for review).
* [x] My PR is ready for review and can be safely merged into a codebase.
--
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]