Page MenuHomeFreeBSD

bcm5974: fix endian conversion signedness bug
ClosedPublic

Authored by val_packett.cool on Mar 3 2022, 11:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 17, 5:13 AM
Unknown Object (File)
Oct 1 2024, 5:55 PM
Unknown Object (File)
Oct 1 2024, 5:55 PM
Unknown Object (File)
Oct 1 2024, 5:54 PM
Unknown Object (File)
Oct 1 2024, 5:40 PM
Unknown Object (File)
Oct 1 2024, 2:25 PM
Unknown Object (File)
Oct 1 2024, 1:51 PM
Unknown Object (File)
Oct 1 2024, 1:14 PM

Details

Summary

This fixes wrong coordinates resulting in weird behavior.

This was correct in the wsp driver originally.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44653
Build 41541: arc lint + arc unit

Event Timeline

sys/dev/hid/bcm5974.c
698

Don't modify input report. It can be exported via hidraw latter.

May be something like this will help?

#define WSP_LE2H(x) ((int32_t)(int16_t)le16toh(x))

With changing type of members of struct tp_finger to uint16_t

Or do sign extension with shifts

val_packett.cool retitled this revision from bcm5974: fix endianness bug to bcm5974: fix endian conversion signedness bug.Mar 4 2022, 3:12 PM

Ouch. Actually, the macro should be named as BCM5974_LE2H rather than WSP_LE2H to follow style. I'll handle that.

This revision is now accepted and ready to land.Mar 4 2022, 9:07 PM
This revision was automatically updated to reflect the committed changes.