aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2012-09-01 15:47:11 -0400
committerJiri Kosina <jkosina@suse.cz>2012-09-02 03:26:46 -0400
commit9bfc8da00b1e74f55a52cc06a0d364f1f7f61ed8 (patch)
tree6643c6edd934129b20a58a2fe1361a461a02f237
parent67ddbb3e6568fb1820b2cc45b00c50702b114801 (diff)
HID: Only dump input if someone is listening
Going through the motions of printing the debug message information takes a long time; using the keyboard can lead to a 160 us irqsoff latency. This patch skips hid_dump_input() when there are no open handles, which brings latency down to 100 us. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8bf8a64e5115..b8485a0106c9 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -996,7 +996,8 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field,
996 struct hid_driver *hdrv = hid->driver; 996 struct hid_driver *hdrv = hid->driver;
997 int ret; 997 int ret;
998 998
999 hid_dump_input(hid, usage, value); 999 if (!list_empty(&hid->debug_list))
1000 hid_dump_input(hid, usage, value);
1000 1001
1001 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { 1002 if (hdrv && hdrv->event && hid_match_usage(hid, usage)) {
1002 ret = hdrv->event(hid, field, usage, value); 1003 ret = hdrv->event(hid, field, usage, value);