瀏覽代碼

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.

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>
Bruno Prémont 13 年之前
父節點
當前提交
63583c6455
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/hid/hid-picolcd_debugfs.c

+ 1 - 1
drivers/hid/hid-picolcd_debugfs.c

@@ -657,7 +657,7 @@ void picolcd_debug_raw_event(struct picolcd_data *data,
 
 
 #define BUFF_SZ 256
 #define BUFF_SZ 256
 	/* Avoid unnecessary overhead if debugfs is disabled */
 	/* Avoid unnecessary overhead if debugfs is disabled */
-	if (!hdev->debug_events)
+	if (list_empty(&hdev->debug_list))
 		return;
 		return;
 
 
 	buff = kmalloc(BUFF_SZ, GFP_ATOMIC);
 	buff = kmalloc(BUFF_SZ, GFP_ATOMIC);