Input: focaltech - use explicitly signed char type
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 20 Mar 2023 04:36:36 +0000 (21:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:50 +0000 (12:10 +0200)
commitf8bdc959cefee58a1a17712f031bfcf3ea3e6ba1
treeb469f89f6404201a38073a2ea376e6960b17f315
parent5ee6df525715002649ba8138f59d77f5d7a1e3c2
Input: focaltech - use explicitly signed char type

commit 8980f190947ba29f23110408e712444884b74251 upstream.

The recent change of -funsigned-char causes additions of negative
numbers to become additions of large positive numbers, leading to wrong
calculations of mouse movement. Change these casts to be explicitly
signed, to take into account negative offsets.

Fixes: 3bc753c06dd0 ("kbuild: treat char as always unsigned")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217211
Link: https://lore.kernel.org/r/20230318133010.1285202-1-Jason@zx2c4.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/mouse/focaltech.c