aboutsummaryrefslogtreecommitdiff
path: root/docs/DRIVER.md
diff options
context:
space:
mode:
authorKai Krakow <kai@kaishome.de>2026-08-08 12:27:06 +0200
committerKai Krakow <kai@kaishome.de>2026-08-09 00:20:08 +0200
commit465ce84d2997e5af6630b88d88b63509d5a88031 (patch)
tree9d25a8d70ddbcda28d261fd5bd20fd8756c92ada /docs/DRIVER.md
parentf014217288927246f92ee876afbbf9de8ba707be (diff)
downloadhid-tmff2-465ce84d2997e5af6630b88d88b63509d5a88031.tar.gz
hid-tmff2-465ce84d2997e5af6630b88d88b63509d5a88031.zip
avoid signed overflow when scaling gain
+ FF_GAIN and the driver gain both use the full 16-bit range. Their product can exceed INT_MAX. Signed overflow is undefined and happens for common settings such as 75 percent times 75 percent. Use a u32 intermediate for the scaling operation. + Pass the configured gain directly when initializing or updating the hardware. This also removes two redundant multiply-divide expressions which could overflow before cancelling out.
Diffstat (limited to 'docs/DRIVER.md')
0 files changed, 0 insertions, 0 deletions