diff options
| author | Aldo Ariel Panzardo <qwe.aldo@gmail.com> | 2026-11-06 09:04:05 -0300 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-11-20 14:59:24 +0100 |
| commit | 07e84ad110427fccfb7b4dd71593bd1ffb3badfe (patch) | |
| tree | 72be4d741035030bf64dde2f6b25a13279196c64 /tools/perf/scripts/python/parallel-perf.py | |
| parent | 4ea5f646f5f0c30f05e0576268f0bb913b1f05e2 (diff) | |
HID: wacom: avoid divide exception in dropped-packet calculation
The dropped-packet calculation uses a modulo against sequence_size
(logical_maximum - logical_minimum + 1). When a HID descriptor
declares a sequence field whose logical range spans all 32-bit
values, sequence_size wraps to zero and the modulo triggers a
divide exception.
Replace the division-based calculation with a branch that computes
the forward distance through the sequence range directly, as
suggested by Jason Gerecke. This keeps the existing int types and
avoids the divide-by-zero without any 64-bit arithmetic.
Fixes: 359673ea3a20 ("HID: wacom: Support sequence numbers smaller than 16-bit")
Cc: stable@vger.kernel.org
Suggested-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions
