lkml.org 
[lkml]   [2023]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] input: alps: fix compatibility with -funsigned-char
Might be wise to clean up a few other ones in that file? Or not. Up to
you:

diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 989228b5a0a4..afbf67c2488a 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -852,8 +852,8 @@ static void alps_process_packet_v6(struct psmouse *psmouse)
x = y = z = 0;

/* Divide 4 since trackpoint's speed is too fast */
- input_report_rel(dev2, REL_X, (char)x / 4);
- input_report_rel(dev2, REL_Y, -((char)y / 4));
+ input_report_rel(dev2, REL_X, (signed char)x / 4);
+ input_report_rel(dev2, REL_Y, -((signed char)y / 4));

psmouse_report_standard_buttons(dev2, packet[3]);

@@ -1104,8 +1104,8 @@ static void alps_process_trackstick_packet_v7(struct psmouse *psmouse)
((packet[3] & 0x20) << 1);
z = (packet[5] & 0x3f) | ((packet[3] & 0x80) >> 1);

- input_report_rel(dev2, REL_X, (char)x);
- input_report_rel(dev2, REL_Y, -((char)y));
+ input_report_rel(dev2, REL_X, (signed char)x);
+ input_report_rel(dev2, REL_Y, -((signed char)y));
input_report_abs(dev2, ABS_PRESSURE, z);

psmouse_report_standard_buttons(dev2, packet[1]);
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 5f0d75a45c80..43a1116c5852 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -382,7 +382,7 @@ static unsigned int elan_convert_resolution(u8 val, u8 pattern)
* ((value from firmware) + 3) * 100 = dpi
*/
int res = pattern <= 0x01 ?
- (int)(char)val * 10 + 790 : ((int)(char)val + 3) * 100;
+ (int)(signed char)val * 10 + 790 : ((int)(signed char)val + 3) * 100;
/*
* We also have to convert dpi to dots/mm (*10/254 to avoid floating
* point).
\
 
 \ /
  Last update: 2023-03-27 01:07    [W:0.087 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site