Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: wacom - use unaligned access where necessary

A few cases of incorrectly using 'le16_to_cpup' instead of
'get_unaligned_le16' have been noticed and fixed.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jason Gerecke and committed by
Dmitry Torokhov
edc8e20a 879f99ef

+9 -9
+9 -9
drivers/input/tablet/wacom_wac.c
··· 928 928 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); 929 929 930 930 if (touch) { 931 - int t_x = le16_to_cpup((__le16 *)&data[offset + 2]); 932 - int c_x = le16_to_cpup((__le16 *)&data[offset + 4]); 933 - int t_y = le16_to_cpup((__le16 *)&data[offset + 6]); 934 - int c_y = le16_to_cpup((__le16 *)&data[offset + 8]); 935 - int w = le16_to_cpup((__le16 *)&data[offset + 10]); 936 - int h = le16_to_cpup((__le16 *)&data[offset + 12]); 931 + int t_x = get_unaligned_le16(&data[offset + 2]); 932 + int c_x = get_unaligned_le16(&data[offset + 4]); 933 + int t_y = get_unaligned_le16(&data[offset + 6]); 934 + int c_y = get_unaligned_le16(&data[offset + 8]); 935 + int w = get_unaligned_le16(&data[offset + 10]); 936 + int h = get_unaligned_le16(&data[offset + 12]); 937 937 938 938 input_report_abs(input, ABS_MT_POSITION_X, t_x); 939 939 input_report_abs(input, ABS_MT_POSITION_Y, t_y); ··· 978 978 for (i = 0; i < contacts_to_send; i++) { 979 979 int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3; 980 980 bool touch = data[offset] & 0x1; 981 - int id = le16_to_cpup((__le16 *)&data[offset + 1]); 981 + int id = get_unaligned_le16(&data[offset + 1]); 982 982 int slot = input_mt_get_slot_by_key(input, id); 983 983 984 984 if (slot < 0) ··· 987 987 input_mt_slot(input, slot); 988 988 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); 989 989 if (touch) { 990 - int x = le16_to_cpup((__le16 *)&data[offset + x_offset + 7]); 991 - int y = le16_to_cpup((__le16 *)&data[offset + x_offset + 9]); 990 + int x = get_unaligned_le16(&data[offset + x_offset + 7]); 991 + int y = get_unaligned_le16(&data[offset + x_offset + 9]); 992 992 input_report_abs(input, ABS_MT_POSITION_X, x); 993 993 input_report_abs(input, ABS_MT_POSITION_Y, y); 994 994 }