1. 20 9月, 2014 9 次提交
  2. 19 9月, 2014 1 次提交
    • P
      eeepc-laptop: simplify parse_arg() · 95369a73
      Paul Bolle 提交于
      parse_arg() has three possible return values:
          -EINVAL if sscanf(), in short, fails;
          zero if "count" is zero; and
          "count" in all other cases
      
      But "count" will never be zero. See, parse_arg() is called by the
      various store functions. And the callchain of these functions starts
      with sysfs_kf_write(). And that function checks for a zero "count". So
      we can stop checking for a zero "count", drop the "count" argument
      entirely, and transform parse_arg() into a function that returns zero on
      success or a negative error. That, in turn, allows to make those store
      functions just return "count" on success. The net effect is that the
      code becomes a bit easier to understand.
      
      A nice side effect is that this GCC warning is silenced too:
          drivers/platform/x86/eeepc-laptop.c: In function ‘store_sys_acpi’:
          drivers/platform/x86/eeepc-laptop.c:279:10: warning: ‘value’ may be used uninitialized in this function [-Wmaybe-uninitialized]
            int rv, value;
      
      Which is, of course, the reason to have a look at parse_arg().
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      95369a73
  3. 18 9月, 2014 7 次提交
  4. 04 9月, 2014 1 次提交
    • D
      toshiba_acpi: fix and cleanup toshiba_kbd_bl_mode_store() · aeaac098
      Dan Carpenter 提交于
      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: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
      aeaac098
  5. 03 9月, 2014 2 次提交
  6. 28 8月, 2014 1 次提交
  7. 20 8月, 2014 1 次提交
  8. 16 8月, 2014 18 次提交