Skip to content

Fix vcam_device type in memset#47

Merged
jserv merged 1 commit into
sysprog21:masterfrom
Shaoen-Lin:fix-vcam-device-type
Jun 2, 2026
Merged

Fix vcam_device type in memset#47
jserv merged 1 commit into
sysprog21:masterfrom
Shaoen-Lin:fix-vcam-device-type

Conversation

@Shaoen-Lin

@Shaoen-Lin Shaoen-Lin commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Pointer vcam_devices stores struct vcam_device pointers. The allocation uses sizeof(struct vcam_device *), but the following memset uses the pluralized struct vcam_devices tag.

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 in memset for vcam_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.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@jserv jserv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Indent with clang-format-18.

@Shaoen-Lin Shaoen-Lin force-pushed the fix-vcam-device-type branch from ccc9b34 to 6365a39 Compare June 2, 2026 06:52
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>
@Shaoen-Lin Shaoen-Lin force-pushed the fix-vcam-device-type branch from 6365a39 to 4aa7c77 Compare June 2, 2026 06:58
@jserv jserv merged commit 9a850d4 into sysprog21:master Jun 2, 2026
2 checks passed
@jserv

jserv commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Thank @Shaoen-Lin for contributing!

@Shaoen-Lin Shaoen-Lin deleted the fix-vcam-device-type branch June 2, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants