HID: picoLCD: optimize for inactive debugfs
authorBruno Prémont <bonbons@linux-vserver.org>
Sun, 19 Aug 2012 17:33:02 +0000 (19:33 +0200)
committerJiri Kosina <jkosina@suse.cz>
Wed, 5 Sep 2012 09:48:07 +0000 (11:48 +0200)
Matthieu CASTET adjusted picolcd_debug_out_report() to only operate when
there is an active listener on debugfs for events.

Do the same on the more important picolcd_debug_raw_event() that is
called in interrupt context as opposed to picolcd_debug_out_report()
which happens in whichever context that sends reports to device.

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

index 15c22f2ee748e78bc231c10b604aeeb420c462d9..2c7308c2ae1f949d1716e640fcffc596381b0904 100644 (file)
@@ -657,7 +657,7 @@ void picolcd_debug_raw_event(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);