Commit 56fa94415b8a1a163e24a105fb5bdadc625c1d2a

Authored by Bruno Prémont
Committed by Jiri Kosina
1 parent 5ed84c341c

HID: picoLCD: optimize for inactive debugfs

Matthieu CASTET adjusted picolcd_debug_out_report() to only operate when
there is an active listener on debugfs for events.

His change got lost while splitting hid_picolcd.c, restore it.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

drivers/hid/hid-picolcd_debugfs.c
... ... @@ -402,7 +402,7 @@
402 402 #define BUFF_SZ 256
403 403  
404 404 /* Avoid unnecessary overhead if debugfs is disabled */
405   - if (!hdev->debug_events)
  405 + if (list_empty(&hdev->debug_list))
406 406 return;
407 407  
408 408 buff = kmalloc(BUFF_SZ, GFP_ATOMIC);