]> git.itanic.dy.fi Git - linux-stable/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>
Thu, 6 Apr 2023 10:12:40 +0000 (12:12 +0200)
commit84ffc04166133a4cc2cccc1cdc8409cf1ebcbf12
tree97c7273f5bb19d7d42231043ec7649abdad70559
parentbd14ccafb03ca7068847fa057f7fab3e96f29962
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: f3f33c677699 ("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