1. 29 Oct, 2013 2 commits
    • Kelley Nielsen's avatar
      staging: ft1000: duplicate code replaced with call to request_code_segment · e0a223b4
      Kelley Nielsen authored
      function scram_dnldr, in ft1000_download.c, is very long and consists
      mainly of nested switch statements inside a while loop. Some code in one
      of the inner switch cases was almost identical to the code in the
      previously extracted function request_code_segment. The duplicated code
      was replaced with a call to request_code_segment, and
      request_code_segment was slightly modified to work in both cases.
      
      A new parameter was added to request_code_segment, a bool to distinguish
      which case it was replacing. The name of an existing parameter (now
      called endpoint) was changed to reflect the fact that it will be passed
      in from more than one place. Several lines from the case containing the
      duplicated code were moved to request_code_segment, and a test was added
      to determine if these lines or a line from the original function should
      be run.
      
      Finally, an unused variable (tempword) was removed from scram_dnldr.
      Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
      Reviewed-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e0a223b4
    • Kelley Nielsen's avatar
      staging: ft1000: function request_code_segment extracted · aaeb94c9
      Kelley Nielsen authored
      function scram_dnldr in ft1000_download.c is very long and contains many
      coding style errors and best practice violations. It consists of nested
      switch statements inside a while loop. One of the inner switch cases has
      been extracted as a helper function. Also, some style errors (such as
      C99 comments) have been fixed, an assignment to an unread variable has
      been removed, and break statements inside ifs have been converted to
      returns.
      Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aaeb94c9
  2. 28 Oct, 2013 38 commits