Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cpu/cortexm_common: Make cpu.h IWYU clean #21050

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Nov 27, 2024

Contribution description

  1. drop #include <stdio.h> from cpu.h. This clearly should not belong here
    • This causes some fallout, as some code relied on cpu.h including <stdio.h>. Those missing includes are added first to ease bisecting
  2. Add IWYU pragma export to cpu_conf.h, as portable code is expected to not include cpu_conf.h directly (which does not exist across MCU families), but indirectly via cpu.h

Testing procedure

Green CI

Issues/PRs references

Split out of #21029

For `gpio_ll_print_conf()` we need to include `<stdio.h>`, when not
using `fmt.h`.
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Nov 27, 2024
@maribu maribu added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Nov 27, 2024
@riot-ci
Copy link

riot-ci commented Nov 27, 2024

Murdock results

✔️ PASSED

faa3727 cpu/cortexm_common: Make cpu.h IWYU clean

Success Failures Total Runtime
10242 0 10246 14m:19s

Artifacts

@maribu maribu force-pushed the cpu/cortexm_common/iwyu-clean branch from 52e1d02 to 44c0675 Compare November 27, 2024 08:18
@github-actions github-actions bot added Area: network Area: Networking Area: pkg Area: External package ports Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Nov 27, 2024
@maribu maribu marked this pull request as draft November 27, 2024 08:18
@maribu maribu removed Area: network Area: Networking Area: pkg Area: External package ports Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Nov 27, 2024
@maribu maribu marked this pull request as ready for review November 27, 2024 08:38
@benpicco benpicco enabled auto-merge November 27, 2024 10:10
@benpicco benpicco added this pull request to the merge queue Nov 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 27, 2024
There is clearly no reason `cpu.h` should `#include <stdio.h>`.

Also add an export pragma to `cpu_conf.h`, as portable code is
expected to include `cpu.h` (which exists across MCU families in RIOT),
and not `cpu_conf.h` (which only exists for some MCU families).
@maribu maribu force-pushed the cpu/cortexm_common/iwyu-clean branch from 44c0675 to faa3727 Compare November 27, 2024 10:57
@github-actions github-actions bot added Area: network Area: Networking Area: pkg Area: External package ports Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: examples Area: Example Applications labels Nov 27, 2024
@maribu maribu enabled auto-merge November 27, 2024 10:57
@maribu maribu removed Area: network Area: Networking Area: pkg Area: External package ports Area: drivers Area: Device drivers Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: examples Area: Example Applications labels Nov 27, 2024
@benpicco benpicco added the CI: no fast fail don't abort PR build after first error label Nov 27, 2024
@maribu maribu added this pull request to the merge queue Nov 27, 2024
Merged via the queue into RIOT-OS:master with commit 9fd4b91 Nov 27, 2024
31 checks passed
@maribu maribu deleted the cpu/cortexm_common/iwyu-clean branch November 27, 2024 15:03
@maribu
Copy link
Member Author

maribu commented Nov 27, 2024

Thx :)

@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: cpu Area: CPU/MCU ports CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants