]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: pidff: Compute INFINITE value instead of using hardcoded 0xffff
authorTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Tue, 25 Feb 2025 22:30:02 +0000 (23:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:31 +0000 (10:15 +0200)
commit5318556ed31fd6964818339e764f6817cc6a2041
tree66ef3b9f7c3f2c2fa8f3f5e4eefc65bc3c9b88fd
parentb15301f289602eb93bc0a0b823a95a0a37b60b0e
HID: pidff: Compute INFINITE value instead of using hardcoded 0xffff

[ Upstream commit 1a575044d516972a1d036d54c0180b9085e21dc6 ]

As per USB PID standard:
INFINITE - Referrers to the maximum value of a range. i.e. if in an 8
bit unsigned field the value of 255 would indicate INFINITE.

Detecting 0xffff (U16_MAX) is still important as we MIGHT get this value
as infinite from some native software as 0 was never actually defined
in Linux' FF api as the infinite value. I'm working on it though.

Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/usbhid/hid-pidff.c