From: Henrik Rydberg Date: Sat, 1 Sep 2012 19:47:11 +0000 (+0200) Subject: HID: Only dump input if someone is listening X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=9bfc8da00b1e74f55a52cc06a0d364f1f7f61ed8;p=~shefty%2Frdma-dev.git 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8bf8a64e511..b8485a0106c 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, struct hid_driver *hdrv = hid->driver; int ret; - hid_dump_input(hid, usage, value); + if (!list_empty(&hid->debug_list)) + hid_dump_input(hid, usage, value); if (hdrv && hdrv->event && hid_match_usage(hid, usage)) { ret = hdrv->event(hid, field, usage, value);