https://github.com/torvalds/linux
Revision aeaac098bd58349d7415acd998089309fd798190 authored by Dan Carpenter on 03 September 2014, 11:44:37 UTC, committed by Darren Hart on 03 September 2014, 17:45:12 UTC
The current code just returns -EINVAL because mode can't be equal to
both 1 and 2.

Also this function is messy so I have cleaned it up:
1) Remove initializers like "int time = -1".  Initializing variables to
   garbage values turns off GCC's uninitialized variable warnings so it
   can lead to bugs.
2) Use kstrtoint() instead of sscanf().
3) Use SCI_KBD_MODE_FNZ and SCI_KBD_MODE_AUTO instead of magic numbers 1
   and 2.
4) Don't check for "mode == -1" because that can't happen.
5) Preserve the error code from toshiba_kbd_illum_status_set().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
1 parent e7fdb76
History
Tip revision: aeaac098bd58349d7415acd998089309fd798190 authored by Dan Carpenter on 03 September 2014, 11:44:37 UTC
toshiba_acpi: fix and cleanup toshiba_kbd_bl_mode_store()
Tip revision: aeaac09
File Mode Size
Kconfig -rw-r--r-- 62.5 KB
Makefile -rw-r--r-- 1.1 KB
calibrate.c -rw-r--r-- 8.5 KB
do_mounts.c -rw-r--r-- 14.3 KB
do_mounts.h -rw-r--r-- 1.4 KB
do_mounts_initrd.c -rw-r--r-- 3.4 KB
do_mounts_md.c -rw-r--r-- 8.2 KB
do_mounts_rd.c -rw-r--r-- 8.7 KB
init_task.c -rw-r--r-- 728 bytes
initramfs.c -rw-r--r-- 13.7 KB
main.c -rw-r--r-- 24.7 KB
noinitramfs.c -rw-r--r-- 1.5 KB
version.c -rw-r--r-- 1.2 KB

back to top