Fix vcam_device type in memset#47
Merged
Merged
Conversation
jserv
requested changes
Jun 1, 2026
jserv
left a comment
Collaborator
There was a problem hiding this comment.
Indent with clang-format-18.
ccc9b34 to
6365a39
Compare
The vcam_devices array stores struct vcam_device pointers. Its allocation uses the same element type, but the memset size uses the pluralized struct vcam_devices tag. Use the actual element type to keep the allocation and initialization consistent. This does not change the cleared size because both expressions are pointer types. Signed-off-by: Shaoen-Lin <shaoen.lin92@gmail.com>
6365a39 to
4aa7c77
Compare
Collaborator
|
Thank @Shaoen-Lin for contributing! |
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.
Pointer
vcam_devicesstores structvcam_devicepointers. The allocation usessizeof(struct vcam_device *), but the followingmemsetuses the pluralized structvcam_devicestag.This does not change the cleared size because the expression is still a pointer type. However, using the actual element type keeps the code consistent with the field declaration and allocation.
Summary by cubic
Use the correct
struct vcam_device *type inmemsetforvcam_devices, matching the allocation and field declaration. The previous pluralized tag (struct vcam_devices *) didn’t affect size, but this keeps the initialization consistent.Written for commit 4aa7c77. Summary will update on new commits.