Skip to content

Conversation

@ndrs-pst
Copy link
Contributor

This PR is dedicated to improving devmem_service.c through the following commits:

  • Use shell_print where applicable
  • Utilize sys_put_be(16|32|64) in memory_dump
  • Drop sys_leXX_to_cpu due to incorrect behavior on big-endian systems.

To improve code clarity, use `shell_print` in place of `shell_fprintf`
with `SHELL_NORMAL` where appropriate.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Replaces direct byte shifting and assignment with `sys_put_be16`,
`sys_put_be32`, and `sys_put_be64` to simplify the `memory_dump` function.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Removes `sys_leXX_to_cpu` calls following `sys_readXX`, which already
returns values in native byte order.
These calls have no effect on little-endian CPUs, but would cause
incorrect behavior on big-endian systems.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
@zephyrbot zephyrbot added the area: Shell Shell subsystem label Oct 28, 2025
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Shell Shell subsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants