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)
Wed, May 8, 3:21 PM
Unknown Object (File)
Sun, May 5, 10:08 PM
Unknown Object (File)
Sun, May 5, 4:33 PM
Unknown Object (File)
Sun, May 5, 9:54 AM
Unknown Object (File)
Wed, May 1, 11:09 PM
Unknown Object (File)
Sat, Apr 27, 8:08 AM
Unknown Object (File)
Mar 22 2024, 11:16 PM
Unknown Object (File)
Mar 22 2024, 11:16 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.