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
F153735700: D34433.id103489.diff
Thu, Apr 23, 7:59 AM
Unknown Object (File)
Mon, Apr 20, 7:54 PM
Unknown Object (File)
Mon, Apr 20, 4:34 AM
Unknown Object (File)
Mon, Apr 20, 4:33 AM
Unknown Object (File)
Mon, Apr 20, 4:33 AM
Unknown Object (File)
Thu, Apr 16, 9:48 AM
Unknown Object (File)
Wed, Apr 15, 5:06 AM
Unknown Object (File)
Sun, Apr 12, 5:23 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.