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

input: use get_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Harvey Harrison and committed by
Linus Torvalds
858ad08c 973ea70c

+17 -17
+8 -8
drivers/input/tablet/aiptek.c
··· 528 528 (aiptek->curSetting.pointerMode)) { 529 529 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; 530 530 } else { 531 - x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); 532 - y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); 533 - z = le16_to_cpu(get_unaligned((__le16 *) (data + 6))); 531 + x = get_unaligned_le16(data + 1); 532 + y = get_unaligned_le16(data + 3); 533 + z = get_unaligned_le16(data + 6); 534 534 535 535 dv = (data[5] & 0x01) != 0 ? 1 : 0; 536 536 p = (data[5] & 0x02) != 0 ? 1 : 0; ··· 613 613 (aiptek->curSetting.pointerMode)) { 614 614 aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; 615 615 } else { 616 - x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); 617 - y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); 616 + x = get_unaligned_le16(data + 1); 617 + y = get_unaligned_le16(data + 3); 618 618 619 619 jitterable = data[5] & 0x1c; 620 620 ··· 679 679 pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; 680 680 681 681 macro = dv && p && tip && !(data[3] & 1) ? (data[3] >> 1) : -1; 682 - z = le16_to_cpu(get_unaligned((__le16 *) (data + 4))); 682 + z = get_unaligned_le16(data + 4); 683 683 684 684 if (dv) { 685 685 /* If the selected tool changed, reset the old ··· 757 757 * hat switches (which just so happen to be the macroKeys.) 758 758 */ 759 759 else if (data[0] == 6) { 760 - macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); 760 + macro = get_unaligned_le16(data + 1); 761 761 if (macro > 0) { 762 762 input_report_key(inputdev, macroKeyEvents[macro - 1], 763 763 0); ··· 952 952 buf[0], buf[1], buf[2]); 953 953 ret = -EIO; 954 954 } else { 955 - ret = le16_to_cpu(get_unaligned((__le16 *) (buf + 1))); 955 + ret = get_unaligned_le16(buf + 1); 956 956 } 957 957 kfree(buf); 958 958 return ret;
+7 -7
drivers/input/tablet/gtco.c
··· 245 245 data = report[i]; 246 246 break; 247 247 case 2: 248 - data16 = le16_to_cpu(get_unaligned((__le16 *)&report[i])); 248 + data16 = get_unaligned_le16(&report[i]); 249 249 break; 250 250 case 3: 251 251 size = 4; 252 - data32 = le32_to_cpu(get_unaligned((__le32 *)&report[i])); 252 + data32 = get_unaligned_le32(&report[i]); 253 253 break; 254 254 } 255 255 ··· 695 695 /* Fall thru */ 696 696 case 1: 697 697 /* All reports have X and Y coords in the same place */ 698 - val = le16_to_cpu(get_unaligned((__le16 *)&device->buffer[1])); 698 + val = get_unaligned_le16(&device->buffer[1]); 699 699 input_report_abs(inputdev, ABS_X, val); 700 700 701 - val = le16_to_cpu(get_unaligned((__le16 *)&device->buffer[3])); 701 + val = get_unaligned_le16(&device->buffer[3]); 702 702 input_report_abs(inputdev, ABS_Y, val); 703 703 704 704 /* Ditto for proximity bit */ ··· 762 762 le_buffer[1] = (u8)(device->buffer[4] >> 1); 763 763 le_buffer[1] |= (u8)((device->buffer[5] & 0x1) << 7); 764 764 765 - val = le16_to_cpu(get_unaligned((__le16 *)le_buffer)); 765 + val = get_unaligned_le16(le_buffer); 766 766 input_report_abs(inputdev, ABS_Y, val); 767 767 768 768 /* ··· 772 772 buttonbyte = device->buffer[5] >> 1; 773 773 } else { 774 774 775 - val = le16_to_cpu(get_unaligned((__le16 *)&device->buffer[1])); 775 + val = get_unaligned_le16(&device->buffer[1]); 776 776 input_report_abs(inputdev, ABS_X, val); 777 777 778 - val = le16_to_cpu(get_unaligned((__le16 *)&device->buffer[3])); 778 + val = get_unaligned_le16(&device->buffer[3]); 779 779 input_report_abs(inputdev, ABS_Y, val); 780 780 781 781 buttonbyte = device->buffer[5];
+2 -2
drivers/input/tablet/kbtab.c
··· 63 63 goto exit; 64 64 } 65 65 66 - kbtab->x = le16_to_cpu(get_unaligned((__le16 *) &data[1])); 67 - kbtab->y = le16_to_cpu(get_unaligned((__le16 *) &data[3])); 66 + kbtab->x = get_unaligned_le16(&data[1]); 67 + kbtab->y = get_unaligned_le16(&data[3]); 68 68 69 69 kbtab->pressure = (data[5]); 70 70