Re: HID: picoLCD: optimize for inactive debugfs
On Sun, 30 Sep 2012, Bruno Prémont wrote: > 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 > --- > > > diff --git a/drivers/hid/hid-picolcd_debugfs.c > b/drivers/hid/hid-picolcd_debugfs.c > index 6ef03be..4809aa1 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); Applied, thanks. -- Jiri Kosina SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
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 --- diff --git a/drivers/hid/hid-picolcd_debugfs.c b/drivers/hid/hid-picolcd_debugfs.c index 6ef03be..4809aa1 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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/6] 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 --- drivers/hid/hid-picolcd_debugfs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hid/hid-picolcd_debugfs.c b/drivers/hid/hid-picolcd_debugfs.c index f18a4c2..dbefab7 100644 --- a/drivers/hid/hid-picolcd_debugfs.c +++ b/drivers/hid/hid-picolcd_debugfs.c @@ -656,7 +656,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); -- 1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/