]> git.baikalelectronics.ru Git - kernel.git/commit
Input: alps - fix compatibility with -funsigned-char
authormsizanoen <msizanoen@qtmlabs.xyz>
Mon, 20 Mar 2023 06:02:56 +0000 (23:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:44 +0000 (11:16 +0200)
commit29bd6a293e01075dc52f627ea7d3d01947fe9ecd
tree60a4692a278f3e2e96c73394ee0b5f1e8abeddca
parent0c6f30a72d52af765feb81146a8f36f29f190be0
Input: alps - fix compatibility with -funsigned-char

commit 754ff5060daf5a1cf4474eff9b4edeb6c17ef7ab upstream.

The AlpsPS/2 code previously relied on the assumption that `char` is a
signed type, which was true on x86 platforms (the only place where this
driver is used) before kernel 6.2. However, on 6.2 and later, this
assumption is broken due to the introduction of -funsigned-char as a new
global compiler flag.

Fix this by explicitly specifying the signedness of `char` when sign
extending the values received from the device.

Fixes: 777e96220062 ("Input: alps - Rushmore and v7 resolution support")
Signed-off-by: msizanoen <msizanoen@qtmlabs.xyz>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230320045228.182259-1-msizanoen@qtmlabs.xyz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/mouse/alps.c