Skip to content

Commit

Permalink
HID: picoLCD: optimize for inactive debugfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bruno Prémont authored and Jiri Kosina committed Oct 1, 2012
1 parent 5ed84c3 commit 56fa944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hid/hid-picolcd_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ void picolcd_debug_out_report(struct picolcd_data *data,
#define BUFF_SZ 256

/* Avoid unnecessary overhead if debugfs is disabled */
if (!hdev->debug_events)
if (list_empty(&hdev->debug_list))
return;

buff = kmalloc(BUFF_SZ, GFP_ATOMIC);
Expand Down

0 comments on commit 56fa944

Please sign in to comment.