Skip to content

Conversation

fabiobaltieri
Copy link
Member

Replace all in-function instances of MIN/MAX/CLAMP with the single evaluation version min/max/clamp.

There's probably no race conditions in these files, but the single evaluation ones save a couple of instructions each so they should save few code bytes and potentially perform better, so they should be preferred in general.

Replace all in-function instances of MIN/MAX/CLAMP with the single
evaluation version min/max/clamp.

There's probably no race conditions in these files, but the single
evaluation ones save a couple of instructions each so they should save
few code bytes and potentially perform better, so they should be
preferred in general.

Signed-off-by: Fabio Baltieri <[email protected]>
@sonarqubecloud
Copy link

Copy link
Member

@aescolar aescolar left a comment

Choose a reason for hiding this comment

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

+1

@fabiobaltieri
Copy link
Member Author

@andyross @peter-mitsis you okay with this? Trying to get it in before the freeze

@jhedberg jhedberg added this to the v4.3.0 milestone Oct 23, 2025
@jhedberg jhedberg merged commit 700a1a5 into zephyrproject-rtos:main Oct 23, 2025
46 checks passed
@fabiobaltieri fabiobaltieri deleted the libkernel-minmax branch October 23, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Base OS Base OS Library (lib/os) area: C Library C Standard Library area: Kernel area: Logging area: Networking Buffers net_buf/net_buf_simple API & implementation area: POSIX POSIX API Library area: Utilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants