wacom: Fix mousewheel up/down regression for old wacom tablets
Subsystems (2)
PATCH 1/1 wacom: Fix mousewheel up/down regression for old wacom tablets
This fixes a regression introduced in3b57ca0f80c5c8994b5b1e3d3f904cfe727951f2.
The data[6] byte contains either 1 or -1 depending on the whether the mouse wheel on older wacom tablets is moved down (1) or up (-1). The patch introduced in the above commit changed the cast from (signed char) to (signed). When cast as a signed integer and negated, the value of -1 (stored in the byte as 0xff) became -255 rather than 1. This patch reverts the cast to a (signed char) and also removes an unnecessary (signed) cast, as all the values operated on are bitmasked.
--- drivers/input/tablet/wacom_wac.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/input/tablet/wacom_wac.c +2 -2
@@ -210,10 +210,10 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)if (features->type ==WACOM_G4 || features->type ==WACOM_MO ) {input_report_abs (input,ABS_DISTANCE , data[6 ] &0x3f ); - rw = (signed )(data[7 ] &0x04 ) - (data[7 ] &0x03 ); + rw = (data[7 ] &0x04 ) - (data[7 ] &0x03 ); }else {input_report_abs (input,ABS_DISTANCE , data[7 ] &0x3f ); - rw = -(signed )data[6 ]; + rw = -(signed char )data[6 ]; }input_report_rel (input,REL_WHEEL , rw); }
Signature · 1 line
1.7.2.2
Quoted 11 lines · Mike Auty
This fixes a regression introduced in
3b57ca0f80c5c8994b5b1e3d3f904cfe727951f2.The data[6] byte contains either 1 or -1 depending on the whether the mouse wheel on older wacom tablets is moved down (1) or up (-1). The patch introduced in the above commit changed the cast from (signed char) to (signed). When cast as a signed integer and negated, the value of -1 (stored in the byte as
0xff) became -255 rather than 1. This patch reverts the cast to a (signed char) and also removes an unnecessary (signed) cast, as all the values operated on are bitmasked.
Quoted 2 lines
Signed-off-by Mike Auty <[email protected]>Reviewed-by Ping Cheng <[email protected]>
Applied, thank you Mike.
Signature · 1 line
Dmitry