Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bfc8da0 authored by Henrik Rydberg's avatar Henrik Rydberg Committed by Jiri Kosina
Browse files

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: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 67ddbb3e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -996,6 +996,7 @@ static void hid_process_event(struct hid_device *hid, struct hid_field *field,
	struct hid_driver *hdrv = hid->driver;
	int ret;

	if (!list_empty(&hid->debug_list))
		hid_dump_input(hid, usage, value);

	if (hdrv && hdrv->event && hid_match_usage(hid, usage)) {