Skip to content

apps: replace atomic_fetch_xxx with atomic_xxx - #3733

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
zhangyu-duck:pr-atomic-rename-new
Aug 24, 2026
Merged

apps: replace atomic_fetch_xxx with atomic_xxx#3733
xiaoxiang781216 merged 1 commit into
apache:masterfrom
zhangyu-duck:pr-atomic-rename-new

Conversation

@zhangyu-duck

@zhangyu-duck zhangyu-duck commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Rename atomic_fetch_xxx to atomic_xxx (e.g., atomic_fetch_add -> atomic_add) and atomic_store/atomic_load to atomic_set/atomic_read, to match the <nuttx/atomic.h> API rename in the companion nuttx PR.

The atomic_fetch_xxx naming is reserved by the C/C++ standard and conflicts with standard library declarations when <atomic>/<stdatomic.h> is included by third-party code.

Files changed

  • crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c
  • testing/libc/atomic/atomic_main.c
  • testing/ostest/roundrobin.c
  • testing/ostest/spinlock.c

jerpelea
jerpelea previously approved these changes Aug 19, 2026
@github-actions

Copy link
Copy Markdown

🔗 Cross-repo PR dependencies

The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):

CI run: https://github.com/apache/nuttx-apps/actions/runs/32134898362

Comment thread testing/libc/atomic/atomic_main.c Outdated
Comment thread testing/libc/atomic/atomic_main.c Outdated
Comment thread testing/libc/atomic/atomic_main.c Outdated
Comment thread testing/libc/atomic/atomic_main.c Outdated
Comment thread testing/libc/atomic/atomic_main.c Outdated
Comment thread testing/libc/atomic/atomic_main.c Outdated
Rename atomic_fetch_xxx to atomic_xxx (e.g., atomic_fetch_add ->
atomic_add) and atomic_store/atomic_load to atomic_set/atomic_read,
to match the <nuttx/atomic.h> API rename in the companion nuttx PR.

The atomic_fetch_xxx naming is reserved by the C/C++ standard and
conflicts with standard library declarations when <atomic>/
<stdatomic.h> is included by third-party code.

Files changed:
- crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c
- testing/libc/atomic/atomic_main.c
- testing/ostest/roundrobin.c
- testing/ostest/spinlock.c

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
@github-actions

Copy link
Copy Markdown

❌ Cross-repo dependency could not be applied

The Build report says the declared dependency PR(s) could not be applied, so CI did not run against the combined code:

Reason: cherry-pick failed (if your PR has merge commits, rebase instead)

CI run: https://github.com/apache/nuttx-apps/actions/runs/32698218070

@zhangyu-duck

Copy link
Copy Markdown
Contributor Author

The checkpatch Mixed case identifier errors in ssl_lib.c are pre-existing issues from the OpenSSL API (e.g., SSL_get1_session, SSL_ASSERT2, SSL_SESSION_free). These are OpenSSL/mbedtls function names defined by the upstream API and cannot be renamed. This PR only changes atomic_fetch_addatomic_add and atomic_fetch_subatomic_sub (2 lines). The entire file is full of these mixed case identifiers, so fixing them would require rewriting the whole file against the OpenSSL API, which is not practical.

@xiaoxiang781216

Copy link
Copy Markdown
Contributor

The checkpatch Mixed case identifier errors in ssl_lib.c are pre-existing issues from the OpenSSL API (e.g., SSL_get1_session, SSL_ASSERT2, SSL_SESSION_free). These are OpenSSL/mbedtls function names defined by the upstream API and cannot be renamed. This PR only changes atomic_fetch_addatomic_add and atomic_fetch_subatomic_sub (2 lines). The entire file is full of these mixed case identifiers, so fixing them would require rewriting the whole file against the OpenSSL API, which is not practical.

let's ignore openssl mix case warning and merge it directly to resolve the ci error:

../nuttx/tools/checkpatch.sh -c -u -m -g 44d1f6c05a57ebd936642dd8127d2d3542f1e2fb..HEAD
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c:50:20: error: Mixed case identifier found
Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c:61:18: error: Mixed case identifier found

@xiaoxiang781216
xiaoxiang781216 merged commit 21bb388 into apache:master Aug 24, 2026
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants