summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd_debugfs.c
Commit message (Collapse)AuthorAgeFilesLines
* HID: picoLCD: optimize for inactive debugfsBruno Prémont2012-10-011-1/+1
| | | | | | | | | | 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>
* HID: picoLCD: bounds check in dump_buff_as_hex()Bruno Prémont2012-09-241-6/+6
| | | | | | | | | | | | | Make sure we keep enough space for terminating NUL character after last newline. If we have too much data, replace last byte with '.'s to make overflow visible. Using hex_dump_to_buffer() is not interesting as it adds more overhead and does not append the trailing linefeed. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picoLCD: fix dumping of IR_DATA reportBruno Prémont2012-09-051-2/+2
| | | | | | | | | The first payload byte indicates how many IR data bytes are following, not including itself. The IR data bytes appear in pairs as they represent a series of 16bit intervals. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picoLCD: optimize for inactive debugfsBruno Prémont2012-09-051-1/+1
| | | | | | | | | | | | 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>
* HID: picolcd: Add missing #include <linux/uaccess.h>Geert Uytterhoeven2012-08-221-0/+1
| | | | | | | | | | | | m68k/allmodconfig: drivers/hid/hid-picolcd_debugfs.c: In function ‘picolcd_debug_reset_write’: drivers/hid/hid-picolcd_debugfs.c:54: error: implicit declaration of function ‘copy_from_user’ drivers/hid/hid-picolcd_debugfs.c: In function ‘picolcd_debug_eeprom_read’: drivers/hid/hid-picolcd_debugfs.c:112: error: implicit declaration of function ‘copy_to_user’ Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picoLCD: satify some checkpatch warningsBruno Prémont2012-08-151-2/+2
| | | | | | | | | | | | | | | | | | | WARNING: static const char * array should probably be static const char * const +static const char *error_codes[] = { WARNING: min() should probably be min_t(size_t, 20, s) + raw_data[2] = min((size_t)20, s); Note: the second min_t suggestion cannot be followed because GCC is not smart enough to track constants through it and make copy_from_user_overflow() check happy. WARNING: min() should probably be min_t(u8, 20, raw_data[2]) + if (copy_from_user(raw_data+3, u, min((u8)20, raw_data[2]))) return -EFAULT; Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: picoLCD: split driver codeBruno Prémont2012-08-151-0/+898
In order to make code maintenance easier, split the vairous functions into individial files (this removes a bunch of #ifdefs). Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
OpenPOWER on IntegriCloud