Skip to content

kernel: mmu: Added a cast to avoid format warnings when logging #90897

New issue

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

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

Already on GitHub? Sign in to your account

Merged

Conversation

soburi
Copy link
Member

@soburi soburi commented May 31, 2025

At runtime, cbprintf outputs a warning of the type check of the print format.
Added a cast to avoid this warning to the first argument of device_map() to void*.

I got the following logs.

[00:00:00.013,000] <wrn> cbprintf_package: (unsigned) char * used for %p argument. It's recommended to cast it to void * because it may cause misbehavior in certain configurations. String:"%s: arch_mem_map(%p, 0x%lx, %zu, %x) offset %lu" argument:1
[00:00:00.013,000] <dbg> os: k_mem_map_phys_bare: arch_mem_map(0x41ffd000, 0x38000000, 4096, 8) offset 0

At runtime, `cbprintf` outputs a warning of the type check of the
print format.
Added a cast to avoid this warning to the first argument of
`device_map()` to `void*`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
@soburi soburi force-pushed the suppress_warining_log_device_map branch from 62428dc to d070933 Compare May 31, 2025 03:10
Copy link

@soburi soburi marked this pull request as ready for review May 31, 2025 04:32
@github-actions github-actions bot added area: Kernel size: XS A PR changing only a single line of code labels May 31, 2025
@soburi
Copy link
Member Author

soburi commented Jun 2, 2025

@andyross @peter-mitsis

Can I have a look at it for a moment?

@kartben kartben merged commit 6fa82f7 into zephyrproject-rtos:main Jun 4, 2025
31 checks passed
@soburi soburi deleted the suppress_warining_log_device_map branch June 4, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants