From 56fa94415b8a1a163e24a105fb5bdadc625c1d2a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Sun, 30 Sep 2012 22:04:19 +0200 Subject: [PATCH] HID: picoLCD: optimize for inactive debugfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Jiri Kosina --- drivers/hid/hid-picolcd_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-picolcd_debugfs.c b/drivers/hid/hid-picolcd_debugfs.c index 6ef03be352c..4809aa1bdb9 100644 --- a/drivers/hid/hid-picolcd_debugfs.c +++ b/drivers/hid/hid-picolcd_debugfs.c @@ -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); -- 2.41.0