Open
Conversation
pillo79
reviewed
Nov 14, 2025
Author
|
@pillo79 I believe that the endianness commit has little to no cost in terms of code space (on little endian platforms) and in a distant future where we may try a big endian platform we have one place less to check to make it compatible. I don't see any other reasons except that this is a free improvement in platform independent code. |
3d1157a to
75baff8
Compare
| sketch_hdr.len = sys_le32_to_cpu(sketch_hdr.len); | ||
| sketch_hdr.magic = sys_le16_to_cpu(sketch_hdr.magic); | ||
|
|
||
| if (sketch_hdr.ver != 0x1 || sketch_hdr.magic != 0x2341) { |
Member
There was a problem hiding this comment.
Suggested change
| if (sketch_hdr.ver != 0x1 || sketch_hdr.magic != 0x2341) { | |
| if (sketch_hdr.ver != SKETCH_VER || sketch_hdr.magic != SKETCH_MAGIC) { |
Consider replacing the magic numbers with #define constants for maintainability
Member
leonardocavagnis
left a comment
There was a problem hiding this comment.
LGTM :)
minor change suggested
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to:
byteorderzephyr librarystruct sketch_header_v1to a union which can simplify the procedure of converting a 16 byte buffer into a C struct and respect the strict aliasing rule.