-
Notifications
You must be signed in to change notification settings - Fork 7.4k
usb : class: hid: Fix fault due to unaligned access #11432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usb : class: hid: Fix fault due to unaligned access #11432
Conversation
cde18e0
to
8d12239
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @finikorg @jfischer-phytec-iot Do you think this UNALIGNED_PUT should be used only for Xtensa platform? If it is generic, we can as well take out the __packed from the structure.
@rgundi we cannot make descriptor table not packed. It is returned via USB requests. |
Codecov Report
@@ Coverage Diff @@
## master #11432 +/- ##
=======================================
Coverage 48.41% 48.41%
=======================================
Files 270 270
Lines 42121 42121
Branches 10139 10139
=======================================
Hits 20394 20394
Misses 17645 17645
Partials 4082 4082 Continue to review full report at Codecov.
|
Thanks. So, should this UNALIGNED_PUT be used only for Xtensa platform? |
@SavinayDharmappa 😕, what is about #8495? |
@jfischer-phytec-iot I was not aware of #8495. |
I think it is OK to have it for all platforms, maybe only it is better to use instead sys_put_le16(). |
@SavinayDharmappa Do you like to take the changes from #8495 over? |
remove "subsys: " from the commit messages... |
@SavinayDharmappa we should do that. |
patch fix fault due to unaligned access while setting hid report size on xtensa platform. Fixes zephyrproject-rtos#11266 Signed-off-by: Savinay Dharmappa <[email protected]>
8d12239
to
4af3183
Compare
Most of those are not needed since they use PUT_UNALIGNED with 1 byte. The only other change needed is modification of wTotalLength IIRC. So please use sys_put_le16() for those 2 changes. |
Let's merge it and discuss further in #8495. |
Use sys_put_le16() for unaligned access, this is refactored work of PR zephyrproject-rtos#8495 PR zephyrproject-rtos#11432 Signed-off-by: Andrei Emeltchenko <[email protected]>
Use sys_put_le16() for unaligned access, this is refactored work of PR #8495 PR #11432 Signed-off-by: Andrei Emeltchenko <[email protected]>
patch fix fault due to unaligned access while setting hid
report size on xtensa platform.
Fixes #11266
Signed-off-by: Savinay Dharmappa [email protected]