diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-04-29 04:03:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:27 -0400 |
commit | 858ad08cf4c32a51d26552d3cb5fa8d5e2f0e579 (patch) | |
tree | 032cb87cf448662e5d4ceb6b25af10aef19d8d99 /drivers/input/tablet | |
parent | 973ea70c7c9be50d5ac34ff82a1c48fbe8fb2efb (diff) |
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>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 16 | ||||
-rw-r--r-- | drivers/input/tablet/gtco.c | 14 | ||||
-rw-r--r-- | drivers/input/tablet/kbtab.c | 4 |
3 files changed, 17 insertions, 17 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 1d759f6f8076..55c1134d6137 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -528,9 +528,9 @@ static void aiptek_irq(struct urb *urb) | |||
528 | (aiptek->curSetting.pointerMode)) { | 528 | (aiptek->curSetting.pointerMode)) { |
529 | aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; | 529 | aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; |
530 | } else { | 530 | } else { |
531 | x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); | 531 | x = get_unaligned_le16(data + 1); |
532 | y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); | 532 | y = get_unaligned_le16(data + 3); |
533 | z = le16_to_cpu(get_unaligned((__le16 *) (data + 6))); | 533 | z = get_unaligned_le16(data + 6); |
534 | 534 | ||
535 | dv = (data[5] & 0x01) != 0 ? 1 : 0; | 535 | dv = (data[5] & 0x01) != 0 ? 1 : 0; |
536 | p = (data[5] & 0x02) != 0 ? 1 : 0; | 536 | p = (data[5] & 0x02) != 0 ? 1 : 0; |
@@ -613,8 +613,8 @@ static void aiptek_irq(struct urb *urb) | |||
613 | (aiptek->curSetting.pointerMode)) { | 613 | (aiptek->curSetting.pointerMode)) { |
614 | aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; | 614 | aiptek->diagnostic = AIPTEK_DIAGNOSTIC_TOOL_DISALLOWED; |
615 | } else { | 615 | } else { |
616 | x = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); | 616 | x = get_unaligned_le16(data + 1); |
617 | y = le16_to_cpu(get_unaligned((__le16 *) (data + 3))); | 617 | y = get_unaligned_le16(data + 3); |
618 | 618 | ||
619 | jitterable = data[5] & 0x1c; | 619 | jitterable = data[5] & 0x1c; |
620 | 620 | ||
@@ -679,7 +679,7 @@ static void aiptek_irq(struct urb *urb) | |||
679 | pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; | 679 | pck = (data[1] & aiptek->curSetting.stylusButtonUpper) != 0 ? 1 : 0; |
680 | 680 | ||
681 | macro = dv && p && tip && !(data[3] & 1) ? (data[3] >> 1) : -1; | 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 | if (dv) { | 684 | if (dv) { |
685 | /* If the selected tool changed, reset the old | 685 | /* If the selected tool changed, reset the old |
@@ -757,7 +757,7 @@ static void aiptek_irq(struct urb *urb) | |||
757 | * hat switches (which just so happen to be the macroKeys.) | 757 | * hat switches (which just so happen to be the macroKeys.) |
758 | */ | 758 | */ |
759 | else if (data[0] == 6) { | 759 | else if (data[0] == 6) { |
760 | macro = le16_to_cpu(get_unaligned((__le16 *) (data + 1))); | 760 | macro = get_unaligned_le16(data + 1); |
761 | if (macro > 0) { | 761 | if (macro > 0) { |
762 | input_report_key(inputdev, macroKeyEvents[macro - 1], | 762 | input_report_key(inputdev, macroKeyEvents[macro - 1], |
763 | 0); | 763 | 0); |
@@ -952,7 +952,7 @@ aiptek_query(struct aiptek *aiptek, unsigned char command, unsigned char data) | |||
952 | buf[0], buf[1], buf[2]); | 952 | buf[0], buf[1], buf[2]); |
953 | ret = -EIO; | 953 | ret = -EIO; |
954 | } else { | 954 | } else { |
955 | ret = le16_to_cpu(get_unaligned((__le16 *) (buf + 1))); | 955 | ret = get_unaligned_le16(buf + 1); |
956 | } | 956 | } |
957 | kfree(buf); | 957 | kfree(buf); |
958 | return ret; | 958 | return ret; |
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index f66ca215cdec..c5a8661a1baa 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c | |||
@@ -245,11 +245,11 @@ static void parse_hid_report_descriptor(struct gtco *device, char * report, | |||
245 | data = report[i]; | 245 | data = report[i]; |
246 | break; | 246 | break; |
247 | case 2: | 247 | case 2: |
248 | data16 = le16_to_cpu(get_unaligned((__le16 *)&report[i])); | 248 | data16 = get_unaligned_le16(&report[i]); |
249 | break; | 249 | break; |
250 | case 3: | 250 | case 3: |
251 | size = 4; | 251 | size = 4; |
252 | data32 = le32_to_cpu(get_unaligned((__le32 *)&report[i])); | 252 | data32 = get_unaligned_le32(&report[i]); |
253 | break; | 253 | break; |
254 | } | 254 | } |
255 | 255 | ||
@@ -695,10 +695,10 @@ static void gtco_urb_callback(struct urb *urbinfo) | |||
695 | /* Fall thru */ | 695 | /* Fall thru */ |
696 | case 1: | 696 | case 1: |
697 | /* All reports have X and Y coords in the same place */ | 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 | input_report_abs(inputdev, ABS_X, val); | 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 | input_report_abs(inputdev, ABS_Y, val); | 702 | input_report_abs(inputdev, ABS_Y, val); |
703 | 703 | ||
704 | /* Ditto for proximity bit */ | 704 | /* Ditto for proximity bit */ |
@@ -762,7 +762,7 @@ static void gtco_urb_callback(struct urb *urbinfo) | |||
762 | le_buffer[1] = (u8)(device->buffer[4] >> 1); | 762 | le_buffer[1] = (u8)(device->buffer[4] >> 1); |
763 | le_buffer[1] |= (u8)((device->buffer[5] & 0x1) << 7); | 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 | input_report_abs(inputdev, ABS_Y, val); | 766 | input_report_abs(inputdev, ABS_Y, val); |
767 | 767 | ||
768 | /* | 768 | /* |
@@ -772,10 +772,10 @@ static void gtco_urb_callback(struct urb *urbinfo) | |||
772 | buttonbyte = device->buffer[5] >> 1; | 772 | buttonbyte = device->buffer[5] >> 1; |
773 | } else { | 773 | } else { |
774 | 774 | ||
775 | val = le16_to_cpu(get_unaligned((__le16 *)&device->buffer[1])); | 775 | val = get_unaligned_le16(&device->buffer[1]); |
776 | input_report_abs(inputdev, ABS_X, val); | 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 | input_report_abs(inputdev, ABS_Y, val); | 779 | input_report_abs(inputdev, ABS_Y, val); |
780 | 780 | ||
781 | buttonbyte = device->buffer[5]; | 781 | buttonbyte = device->buffer[5]; |
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 1182fc133167..f23f5a97fb38 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c | |||
@@ -63,8 +63,8 @@ static void kbtab_irq(struct urb *urb) | |||
63 | goto exit; | 63 | goto exit; |
64 | } | 64 | } |
65 | 65 | ||
66 | kbtab->x = le16_to_cpu(get_unaligned((__le16 *) &data[1])); | 66 | kbtab->x = get_unaligned_le16(&data[1]); |
67 | kbtab->y = le16_to_cpu(get_unaligned((__le16 *) &data[3])); | 67 | kbtab->y = get_unaligned_le16(&data[3]); |
68 | 68 | ||
69 | kbtab->pressure = (data[5]); | 69 | kbtab->pressure = (data[5]); |
70 | 70 | ||