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)
Mon, Dec 15, 7:58 PM
Unknown Object (File)
Sat, Nov 22, 7:22 PM
Unknown Object (File)
Nov 20 2025, 2:50 AM
Unknown Object (File)
Nov 19 2025, 3:45 AM
Unknown Object (File)
Nov 18 2025, 3:49 AM
Unknown Object (File)
Nov 3 2025, 9:12 AM
Unknown Object (File)
Nov 2 2025, 4:57 AM
Unknown Object (File)
Oct 29 2025, 9:28 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 44639
Build 41527: arc lint + arc unit

Event Timeline

sys/dev/hid/bcm5974.c
696

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.