Skip to content

Conversation

@ndrs-pst
Copy link
Contributor

This PR includes 2 changes as follows:

  • Make the w5500_api_funcs structure const to indicate that it should not be modified.
  • Improve type consistency especially len parameter.

This change marks `w5500_api_funcs`, an instance of
the `ethernet_api`, as `const`.

By using `const`, we ensure immutability, leading to usage of only
`.rodata` and a reduction in the `.data` area.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
Improve type safety and consistency by adjusting variable and
parameter types to avoid signed/unsigned comparisons and implicit casts.

Moreover, explicit casts were applied when converting from
`size_t` to `uint16_t`.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
Copy link
Member

@parthitce parthitce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nashif nashif merged commit d81a8d4 into zephyrproject-rtos:main Nov 19, 2024
27 checks passed
@ndrs-pst ndrs-pst deleted the pr_eth_w5500_refactor branch November 20, 2024 02:27
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.

6 participants