1. 30 Oct, 2013 9 commits
  2. 29 Oct, 2013 24 commits
    • Larry Finger's avatar
      staging: r8188eu: Fix sparse warnings in rtl_p2p.c · 0e51fc36
      Larry Finger authored
      Sparse displays the following:
      
        CHECK   drivers/staging/rtl8188eu/core/rtw_p2p.c
      drivers/staging/rtl8188eu/core/rtw_p2p.c:162:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_p2p.c:162:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_p2p.c:162:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_p2p.c:221:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_p2p.c:221:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_p2p.c:221:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_p2p.c:292:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_p2p.c:292:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_p2p.c:292:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_p2p.c:371:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_p2p.c:371:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_p2p.c:371:15:    got restricted __le16 *<noident>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0e51fc36
    • Larry Finger's avatar
      staging: r8188eu: Fix sparse warnings in rtw_mlme_ext.c · ac049e30
      Larry Finger authored
      Sparse displays the following:
      
        CHECK   drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:1874:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:1874:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:1874:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2221:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2221:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2221:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2583:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2583:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2583:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2750:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2750:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:2750:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3002:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3002:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3002:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3197:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3197:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3197:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3311:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3311:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3311:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3563:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3563:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:3563:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4522:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4522:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4522:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4750:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4750:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4750:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4906:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4906:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:4906:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5040:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5040:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5040:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5184:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5184:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5184:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5322:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5322:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5322:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5654:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5654:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5654:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5769:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5769:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5769:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5894:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5894:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5894:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5996:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5996:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:5996:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6066:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6066:15:    expected unsigned short [usertype] *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6066:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6200:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6200:15:    expected unsigned short *fctrl
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:6200:15:    got restricted __le16 *<noident>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ac049e30
    • Larry Finger's avatar
      staging: r8188eu: Fix sparse warnings in rtl8188e.cmd.c · c4af455f
      Larry Finger authored
      Sparse displays the following:
      
        CHECK   drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:285:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:285:15:    expected unsigned short [usertype] *fctrl
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:285:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:368:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:368:15:    expected unsigned short [usertype] *fctrl
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:368:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:403:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:403:15:    expected unsigned short [usertype] *fctrl
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:403:15:    got restricted __le16 *<noident>
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:465:15: warning: incorrect type in assignment (different base types)
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:465:15:    expected unsigned short [usertype] *fctrl
      drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c:465:15:    got restricted __le16 *<noident>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c4af455f
    • Larry Finger's avatar
      staging: r8188eu: Fix sparse warnings in rtw_ieee80211.c · be987763
      Larry Finger authored
      Sparse reports the following:
      
        CHECK   drivers/staging/rtl8188eu/core/rtw_ieee80211.c
      drivers/staging/rtl8188eu/core/rtw_ieee80211.c:1593:14: warning: cast to restricted __le16
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be987763
    • Ian Abbott's avatar
      staging: comedi: s626: replace S626_MULT_X? values · 7a1046e5
      Ian Abbott authored
      Replace the use of the `S626_MULT_X1`, `S626_MULT_X2` and `S626_MULT_X4`
      clock multiplier values with the equivalent `S626_CLKMULT_1X`,
      `S626_CLKMULT_2X` and `S626_CLKMULT_4X` values to avoid duplication.
      Replace the use of `S626_MULT_X0` with a new macro
      `S626_CLKMULT_SPECIAL` (this is treated specially by the
      'ClkMultA'/'ClkMultB' field of the 'CRA'/'CRB' register).  Remove the
      now unused `S626_MULT_X?` macros.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7a1046e5
    • Ian Abbott's avatar
      staging: comedi: s626: remove S626_BF_* macros · 43ce748f
      Ian Abbott authored
      The `S626_BF_*` bitfield position macros are no longer used and are just
      a subset of the corresponding `S626_STDBIT_*` bitfield position macros.
      Remove them.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      43ce748f
    • Ian Abbott's avatar
      staging: comedi: s626: expand standardized IndxSrc values · 2cea19fa
      Ian Abbott authored
      The 'IndxSrc' value for the standardized encoder setup is currently 1
      bit wide and takes one of the following values:
      
        S626_INDXSRC_HARD = 0 // index source from hardware encoder
        S626_INDXSRC_SOFT = 1 // index source software controlled by IndxPol
      
      However the hardware 'IndxSrcA' and 'IndxSrcB' values for the 'A' and
      'B' counters are 2 bits wide.  The above standardized values 0 and 1
      correspond to the hardware values 0 and 2.
      
      In order to simplify conversions between the standardized values and
      hardware values, expand the range of standardized values to cover all
      four possible values.  The new values are as follows:
      
        S626_INDXSRC_ENCODER = 0  // index source from hardware encoder
        S626_INDXSRC_DIGIN = 1    // index source from digital inputs
        S626_INDXSRC_SOFT = 2     // index source s/w controlled by IndxPol
        S626_INDXSRC_DISABLED = 2 // index source disabled
      
      (Note the change in value for `S626_INDXSRC_SOFT` and the replacement of
      `S626_INDXSRC_HARD` with `S626_INDXSRC_ENCODER` for consistency with the
      `CntSrc` values.)
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2cea19fa
    • Ian Abbott's avatar
      staging: comedi: s626: make CRA and CRB setup conversions more readable · 0830ada5
      Ian Abbott authored
      Use the new macros defined in "s626.h" for constructing and decomposing
      'CRA', 'CRB' and standardized encoder setup values to make the
      conversions between standardized encoder setup values, and CRA/CRB
      register values easier to follow.
      
      There is some messing about with the 'IndxSrc' values which are 1-bit
      wide in the standardized encoder setup, and 2-bit wide in the 'CRA' and
      'CRB' register values.  This will be addressed by a later patch.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0830ada5
    • Wei Yongjun's avatar
      staging: drm/imx: fix return value check in imx_drm_init() · 2eaaccde
      Wei Yongjun authored
      In case of error, the function platform_device_register_simple() returns
      ERR_PTR() and never returns NULL. The NULL test in the return value check
      should be replaced with IS_ERR().
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Acked-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2eaaccde
    • Ian Abbott's avatar
      staging: comedi: adl_pci9118: fix a misaligned comment · 95fd62a1
      Ian Abbott authored
      As pointed out by Hartley Sweeten, one of my recent patches resulted in
      the start of a multi-line comment ending up misaligned.  Fix it.
      Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95fd62a1
    • Larry Finger's avatar
      staging: r8188eu: Set device type to wlan · 0d1206be
      Larry Finger authored
      The latest version of NetworkManager does not recognize the device as wireless
      without this change.
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Cc: Stable <stable@vger.kernel.org> # [3.12+]
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d1206be
    • Joe Perches's avatar
      staging: Remove OOM message after input_allocate_device · f99a92c3
      Joe Perches authored
      Emitting an OOM message isn't necessary after input_allocate_device
      as there's a generic OOM and a dump_stack already done.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Acked-by: default avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f99a92c3
    • Luka Perkov's avatar
      staging: octeon: drop redundant mac address check · 4d978452
      Luka Perkov authored
      Checking if MAC address is valid using is_valid_ether_addr() is already done in
      of_get_mac_address().
      Signed-off-by: default avatarLuka Perkov <luka@openwrt.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4d978452
    • Kevin McKinney's avatar
      Staging: bcm: Fix WARNING: space prohibited before semicolon. · 923fb2ae
      Kevin McKinney authored
      This patch removes a space before semicolon as
      specified by checkpatch.pl.
      Signed-off-by: default avatarKevin McKinney <klmckinney1@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      923fb2ae
    • Chuong Ngo's avatar
      drivers: staging: bcm: Removed a developer debug statement. · 0cd2da41
      Chuong Ngo authored
      Removed a developer debug statement per the TODO list.  Additionally,
      removed braces for the if-statement to match coding style.
      Signed-off-by: default avatarChuong Ngo <cngo.github@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0cd2da41
    • Himangi Saraogi's avatar
      Stging: bcm: Adapter.h : removed typedef from struct _U_IP_ADDRESS and changed it to lowercase · d5a49967
      Himangi Saraogi authored
      Running checkpatch.pl on the file drivers/staging/bcm/Adapter.h gave
      an error as it is a mistake to use typedef for structures
      according to CodeingStyle as it reduces readability. The typedef was
      removed and all occurrences of the typedef union were replaced with
      union u_ip_address as types are all lowercase.
      Signed-off-by: default avatarHimangi Saraogi <himangi774@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d5a49967
    • Ebru Akagunduz's avatar
      Staging: winbond: Fix Sparse Warnings in reg.c · 17607ca2
      Ebru Akagunduz authored
      This patch fixes the Sparse Warnings "symbol was
      not declared. Should it be static?" and "defined
      but not used [-Wunused-variable]"
      in reg.c
      Signed-off-by: default avatarEbru Akagunduz <ebru.akagunduz@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17607ca2
    • Ebru Akagunduz's avatar
      Staging: winbond: Fix Sparse Warnings in phy_calibration.c · 06c789ed
      Ebru Akagunduz authored
      This patch fixes Sparse Warnings "symbol was not
      declared. Should it be static?" and "defined
      but not used [-Wunused-function]" in
      phy_calibration.c
      Signed-off-by: default avatarEbru Akagunduz <ebru.akagunduz@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06c789ed
    • Teodora Baluta's avatar
      staging: comedi: use memdup_user to simplify code · f0c80e4e
      Teodora Baluta authored
      Use memdup_user rather than duplicating implementation. Fix following
      coccinelle warnings:
      
      drivers/staging/comedi/comedi_fops.c:1425:5-12: WARNING opportunity for memdup_user
      drivers/staging/comedi/comedi_fops.c:1553:6-13: WARNING opportunity for memdup_user
      Signed-off-by: default avatarTeodora Baluta <teobaluta@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f0c80e4e
    • Kelley Nielsen's avatar
      staging: ft1000: status variables changed to int in ft1000_download.c · 8cf9ff57
      Kelley Nielsen authored
      Linux uses a return type of int for status codes. The file
      ft1000_download.c uses a mixture of u16 and u32. This patch changes all
      variables called status or Status to ints, whether they are returned
      from the function or not. It also changes the return type of all
      functions returning one of the variables to correspond. Also, the
      declaration of scram_dnldr has been changed in ft1000_usb.h.
      Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8cf9ff57
    • Kelley Nielsen's avatar
      staging: ft1000: style issues fixed in write_blk · 74827f8d
      Kelley Nielsen authored
      function write_blk, in ft1000_download.c, contains many coding style
      issues. It has indentations of 3 spaces, long lines, C99 comments, and
      extra whitespace. It also has a return type of u32, and changing the
      returned variable in the function triggers a checkpatch leading spaces
      warning. Indentation should be fixed throughout the file for
      consistency.
      
      This patch fixes those issues, in preparation for correcting the status
      return type throughout the file. The variable Status has been changed
      from u32 to int and renamed status.
      Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      74827f8d
    • Kelley Nielsen's avatar
      staging: ft1000: function write_dpram32_and_check extracted from write_blk · eb2ec639
      Kelley Nielsen authored
      function write_blk is long and overly complex, consisting of a triply
      nested loop. It also has improper indentation and line lengths
      throughout, and has return type of u32 rather than int. Some of the
      lines, when converted to proper indentation, create checkpatch warnings
      for too many leading tabs.
      
      This patch extracts the innermost loop into its own function,
      write_dpram32_and_check. This removes several levels of indentation from
      the extracted lines and makes the original function simpler. Two local
      variables from the original function, u16 resultbuffer[] and a loop
      counter, have been made local variables of the new function. Two calls
      to msleep() have been replaced with usleep_range() as per Documentation/
      timers/timers-howto.txt (which was referred to in a checkpatch warning).
      Several other style issues in the extracted code have been corrected as
      well.
      Signed-off-by: default avatarKelley Nielsen <kelleynnn@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb2ec639
    • 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
  3. 28 Oct, 2013 7 commits