]> git.hungrycats.org Git - linux/commit
HID: wacom: Interpret tilt data from Intuos Pro BT as signed values
authorJason Gerecke <jason.gerecke@wacom.com>
Mon, 28 Oct 2024 17:39:14 +0000 (10:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:21 +0000 (13:54 +0100)
commitc53004b59bb9636f4260fa0396f15bf0f2362259
tree4ce8f353b617dbf1bdea3e43d70b20244009ab32
parent9d63c0eeddc2636109087b27e34fd8cf829c0721
HID: wacom: Interpret tilt data from Intuos Pro BT as signed values

commit 49a397ad24ee5e2c53a59dada2780d7e71bd3f77 upstream.

The tilt data contained in the Bluetooth packets of an Intuos Pro are
supposed to be interpreted as signed values. Simply casting the values
to type `char` is not guaranteed to work since it is implementation-
defined whether it is signed or unsigned. At least one user has noticed
the data being reported incorrectly on their system. To ensure that the
data is interpreted properly, we specifically cast to `signed char`
instead.

Link: https://github.com/linuxwacom/input-wacom/issues/445
Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface")
CC: stable@vger.kernel.org # 4.11+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_wac.c