diff options
| author | Kai Krakow <kai@kaishome.de> | 2026-08-08 12:27:06 +0200 |
|---|---|---|
| committer | Kai Krakow <kai@kaishome.de> | 2026-08-09 00:20:08 +0200 |
| commit | 465ce84d2997e5af6630b88d88b63509d5a88031 (patch) | |
| tree | 9d25a8d70ddbcda28d261fd5bd20fd8756c92ada /hid-tmff2.mod.c | |
| parent | f014217288927246f92ee876afbbf9de8ba707be (diff) | |
| download | hid-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 'hid-tmff2.mod.c')
0 files changed, 0 insertions, 0 deletions
