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)
Fri, Mar 22, 11:16 PM
Unknown Object (File)
Fri, Mar 22, 11:16 PM
Unknown Object (File)
Feb 18 2024, 2:16 PM
Unknown Object (File)
Jan 14 2024, 7:49 AM
Unknown Object (File)
Dec 20 2023, 8:04 AM
Unknown Object (File)
Dec 18 2023, 4:25 PM
Unknown Object (File)
Sep 21 2023, 4:57 PM
Unknown Object (File)
Aug 26 2023, 2:17 PM

Details

Summary

This fixes wrong coordinates resulting in weird behavior.

This was correct in the wsp driver originally.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.