diff options
Diffstat (limited to 'drivers/hid/hid-debug.c')
-rw-r--r-- | drivers/hid/hid-debug.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 6abd0369aedb..56f314fbd4f9 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/debugfs.h> | 29 | #include <linux/debugfs.h> |
30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
31 | #include <linux/sched.h> | 31 | #include <linux/sched.h> |
32 | #include <linux/slab.h> | ||
32 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
33 | #include <linux/poll.h> | 34 | #include <linux/poll.h> |
34 | 35 | ||
@@ -564,10 +565,10 @@ void hid_debug_event(struct hid_device *hdev, char *buf) | |||
564 | struct hid_debug_list *list; | 565 | struct hid_debug_list *list; |
565 | 566 | ||
566 | list_for_each_entry(list, &hdev->debug_list, node) { | 567 | list_for_each_entry(list, &hdev->debug_list, node) { |
567 | for (i = 0; i <= strlen(buf); i++) | 568 | for (i = 0; i < strlen(buf); i++) |
568 | list->hid_debug_buf[(list->tail + i) % (HID_DEBUG_BUFSIZE - 1)] = | 569 | list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] = |
569 | buf[i]; | 570 | buf[i]; |
570 | list->tail = (list->tail + i) % (HID_DEBUG_BUFSIZE - 1); | 571 | list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE; |
571 | } | 572 | } |
572 | } | 573 | } |
573 | EXPORT_SYMBOL_GPL(hid_debug_event); | 574 | EXPORT_SYMBOL_GPL(hid_debug_event); |
@@ -864,13 +865,13 @@ static const char **names[EV_MAX + 1] = { | |||
864 | [EV_SND] = sounds, [EV_REP] = repeats, | 865 | [EV_SND] = sounds, [EV_REP] = repeats, |
865 | }; | 866 | }; |
866 | 867 | ||
867 | void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f) { | 868 | static void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f) |
868 | 869 | { | |
869 | seq_printf(f, "%s.%s", events[type] ? events[type] : "?", | 870 | seq_printf(f, "%s.%s", events[type] ? events[type] : "?", |
870 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); | 871 | names[type] ? (names[type][code] ? names[type][code] : "?") : "?"); |
871 | } | 872 | } |
872 | 873 | ||
873 | void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) | 874 | static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) |
874 | { | 875 | { |
875 | int i, j, k; | 876 | int i, j, k; |
876 | struct hid_report *report; | 877 | struct hid_report *report; |