hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/input/mouse/alps.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ALPS touchpad PS/2 mouse driver
34 *
....@@ -9,10 +10,6 @@
910 *
1011 * ALPS detection, tap switching and status querying info is taken from
1112 * tpconfig utility (by C. Scott Ananian and Bruce Kall).
12
- *
13
- * This program is free software; you can redistribute it and/or modify it
14
- * under the terms of the GNU General Public License version 2 as published by
15
- * the Free Software Foundation.
1613 */
1714
1815 #include <linux/slab.h>
....@@ -855,8 +852,8 @@
855852 x = y = z = 0;
856853
857854 /* Divide 4 since trackpoint's speed is too fast */
858
- input_report_rel(dev2, REL_X, (char)x / 4);
859
- input_report_rel(dev2, REL_Y, -((char)y / 4));
855
+ input_report_rel(dev2, REL_X, (s8)x / 4);
856
+ input_report_rel(dev2, REL_Y, -((s8)y / 4));
860857
861858 psmouse_report_standard_buttons(dev2, packet[3]);
862859
....@@ -1107,8 +1104,8 @@
11071104 ((packet[3] & 0x20) << 1);
11081105 z = (packet[5] & 0x3f) | ((packet[3] & 0x80) >> 1);
11091106
1110
- input_report_rel(dev2, REL_X, (char)x);
1111
- input_report_rel(dev2, REL_Y, -((char)y));
1107
+ input_report_rel(dev2, REL_X, (s8)x);
1108
+ input_report_rel(dev2, REL_Y, -((s8)y));
11121109 input_report_abs(dev2, ABS_PRESSURE, z);
11131110
11141111 psmouse_report_standard_buttons(dev2, packet[1]);
....@@ -1932,7 +1929,7 @@
19321929 static int alps_absolute_mode_v6(struct psmouse *psmouse)
19331930 {
19341931 u16 reg_val = 0x181;
1935
- int ret = -1;
1932
+ int ret;
19361933
19371934 /* enter monitor mode, to write the register */
19381935 if (alps_monitor_mode(psmouse, true))
....@@ -2297,20 +2294,20 @@
22972294 if (reg < 0)
22982295 return reg;
22992296
2300
- x_pitch = (char)(reg << 4) >> 4; /* sign extend lower 4 bits */
2297
+ x_pitch = (s8)(reg << 4) >> 4; /* sign extend lower 4 bits */
23012298 x_pitch = 50 + 2 * x_pitch; /* In 0.1 mm units */
23022299
2303
- y_pitch = (char)reg >> 4; /* sign extend upper 4 bits */
2300
+ y_pitch = (s8)reg >> 4; /* sign extend upper 4 bits */
23042301 y_pitch = 36 + 2 * y_pitch; /* In 0.1 mm units */
23052302
23062303 reg = alps_command_mode_read_reg(psmouse, reg_pitch + 1);
23072304 if (reg < 0)
23082305 return reg;
23092306
2310
- x_electrode = (char)(reg << 4) >> 4; /* sign extend lower 4 bits */
2307
+ x_electrode = (s8)(reg << 4) >> 4; /* sign extend lower 4 bits */
23112308 x_electrode = 17 + x_electrode;
23122309
2313
- y_electrode = (char)reg >> 4; /* sign extend upper 4 bits */
2310
+ y_electrode = (s8)reg >> 4; /* sign extend upper 4 bits */
23142311 y_electrode = 13 + y_electrode;
23152312
23162313 x_phys = x_pitch * (x_electrode - 1); /* In 0.1 mm units */