1. 02 Aug, 2018 5 commits
  2. 01 Aug, 2018 21 commits
  3. 30 Jul, 2018 14 commits
    • Colin Ian King's avatar
      iio: light: si1133 fix test for val being not zero or not one. · 1e96e93a
      Colin Ian King authored
      The current check on val always results in true and so the
      call to sii1133_update_adcsens never gets called. Fix this check
      so it returns with -EINVAL only when val is not zero and not one.
      
      Detected by CoverityScan, CID#1472099 ("Logically dead code")
      
      Fixes: e01e7eaf ("iio: light: introduce si1133")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      1e96e93a
    • John Whitmore's avatar
      staging:rtl8192u: Refactor enum DM_CCK_Rx_Path_Method - Style · 1c58e9cc
      John Whitmore authored
      The enumerated type DM_CCK_Rx_Path_Method is used as a container for
      constant definitions, rather then an enumerated type enabling compiler
      type checking. To correct this, the variable which uses the constants,
      defined by the enumeration, has had its type changed from a u8 to the
      enumeration.
      
      Additionally the type has been moved above the structure where the type
      is used, to avoid compiler error. The typedef has been removed from the
      enumerated type to clear the checkpatch issue with defining new types.
      The name of the type has been changed to cck_rx_path_method to clear
      the checkpatch issue with CamelCase naming. And the enumerated constant
      CCK_Rx_Version_MAX has been removed, since it is never used in code.
      
      The changes are all coding style in nature and so should have no
      impact on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1c58e9cc
    • John Whitmore's avatar
      staging:rtl8192u: Refactor enum dm_dig_cs_ratio_e - Style · cff3d470
      John Whitmore authored
      The enumerated type dm_dig_cs_ratio_e is never actually used as a type,
      but only as a collection of related constants. This is because the
      variables, which use the defined constant values, are defined as being
      of type u8 rather then tne enumerated type. This omission negates the
      possibility of taking advantage of compiler type checking.
      
      To enable the use of compiler type checking of the enumeration the two
      variables, (curcs_ratio_state & precs_ratio_state), which use the type's
      constants have their types changed from u8 to enum dig_cck_cs_ratio_state.
      
      Additionally the types declaration has been moved above the dig
      structure, where the type is used. The 'typedef' keyword has been
      removed from the type to clear the checkpatch issue with defining new
      types. And the constant DIG_CS_MAX has been removed since this is never
      used in the code.
      
      These changes are purely coding style changes and should not impact
      on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cff3d470
    • John Whitmore's avatar
      staging:rtl8192u: Refactor enum dm_dig_pd_th_e - Style · a48aa566
      John Whitmore authored
      The enumerated type dm_dig_pd_th_e is never actually used as
      the type for the two variables which use the constants, which the
      enumeration defines. This omission removes the possibility of taking
      advantage of compiler type checking.
      
      To correct this the two member variables, (curpd_thstate & prepd_thstate)
      have been changed to use the type enum dig_pkt_detection_threshold rather
      then u8.
      
      Additionally the enum's declaration has been moved above the dig
      structure, where the type is used, the 'typedef' has been removed to
      clear the checkpatch issue with defining new types, and the value
      'DIG_PD_MAX' has been removed from the enumeration, since it is never
      used in code.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a48aa566
    • John Whitmore's avatar
      staging:rtl8192u: Refactor dm_dig_connect_e - Style · c3575c7c
      John Whitmore authored
      The enumerated type dm_dig_connect_e is only used to group constant
      values, as the actual type is never used as the type for the variables
      which use the defined constants (cur_connect_state and pre_connect_state).
      
      These two member variables have had there defined types changed to
      properly reflect there usage and to permit compiler type checks to be
      performed.
      
      In addition the definition of the enumerated type has been moved above
      the structure which uses the type. The typedef of the enumerated type
      has been removed to clear the checkpatch issue with defining new types
      and the enumerated value DIG_CONNECT_MAX has been removed since it is
      never used in code.
      
      The resulting changes are all coding style in nature and should not
      impact runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c3575c7c
    • John Whitmore's avatar
      staging:rtl8192u: Remove unused enum dm_dig_dbg_e - Style · 98881511
      John Whitmore authored
      The enumerated type dm_dig_dbg_e is never used in code so has simply
      been removed from the source code.
      
      this is a coding style change which should have no impact on runtime
      code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      98881511
    • John Whitmore's avatar
      staging:rtl8192u: Refactor enum dm_dig_alg_e - Style · ebd0dcbd
      John Whitmore authored
      The enumerated type dm_dig_alg_e is only used by one variable in the
      code, 'dig_algorithm', a member variable of the structure dig. That
      member variable was defined to be of type 'u8' thus negating any
      advantage of the use of an enumerated type, (compiler type-checking).
      
      The type of the variable 'dig_algorithm' has been change to reflect
      its use of the enumeration and the enumerated type moved in the file
      so that it appears before it is used in the file.
      
      Additionally the 'typedef' has been removed to clear the checkpatch
      issue with defining new types, and the type renamed to
      enum dig_algorithm.
      
      The enumerated constant DIG_ALGO_MAX has been removed from the type
      since it is never used in the code.
      
      These changes are all coding style in nature and as such should have
      no impact on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebd0dcbd
    • John Whitmore's avatar
      staging:rtl8192u: Remove enum dm_dig_op_e - Style · fb2a2729
      John Whitmore authored
      Remove the enumerated type dm_dig_op_e. The type is only used as a
      parameter to the function dm_change_dynamic_initgain_thresh(), but
      that function is never referenced in the code at all.
      
      I would consider this to be a coding style change as the function is
      never referenced and as a result the enumeration is never used. In
      any case there should be no impact on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fb2a2729
    • John Whitmore's avatar
      staging:rtl8192u: Refactor enum dm_ratr_sta_e usage - Style · 06761ce4
      John Whitmore authored
      The enumerated type dm_ratr_sta_e was defined in the file
      drivers/staging/rtl8192u/r8192U_dm.h but never actually used in that
      file. The only variable which uses this enumerated type is 'ratr_state',
      a member variable of the _rate_adaptive structure defined in the file
      drivers/staging/rtl8192u/r8192U.h.
      
      To clarify and place the enumerated type close to where it is used the
      type was moved to the drivers/staging/rtl8192u/r8192U.h file.
      
      In addition the member variable 'ratr_state' which uses the enumerated
      constants was declared as being of type 'u8'. This negates any advantage
      of the enumerated type, compiler type-checking, so that member variable's
      type has been changed to being of the enumerated type.
      
      The typedef from the enumerated type has been removed to clear the
      checkpatch issue with defining new types. Additionally the name of the
      type has been left as enum dynamic_ratr_state
      
      This is a coding style change and should have no impact on runtime code
      execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      06761ce4
    • John Whitmore's avatar
      staging:rtl8192u: Refactor use of enum dm_dig_sta_e - Style · e0043d14
      John Whitmore authored
      Refactor the use of the enumerated type dm_dig_sta_e, which is not
      actually used for type checking by the compiler.
      
      The typedef of dm_dig_sta_e is removed to clear the checkpatch issue
      with defining new types, and the enumerated type is left with the name
      enum dynamic_init_gain_state
      
      The enumerated type defines values for the enumeration, which are used
      by both dig_state and dig_highpwr_state, (members of the struct dig).
      Both of those variables were defined as being of type u8. This negates
      any usefulness of the use of the enumeration, (compiler type checking).
      
      To make use of the compiler's type-checking the two member variables,
      dig_state and dig_highpwr_state have been changed to being of type
      enum dynamic_init_gain_state. The enumerated type has been moved above
      the struct dig definition so that the enumeration is already defined
      when the compiler reaches the two types using the enumerated type.
      
      These changes, whilst convoluted, are purely coding style in nature and
      should not impact runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e0043d14
    • John Whitmore's avatar
      staging:rtl8192u: Remove typedef of cmpk_set_cfg_t - Style · e2102bc3
      John Whitmore authored
      Remove the typedef from cmpk_set_cfg_t, leaving the structure as
      struct cmd_pkt_set_configuration. This change clears the checkpatch
      issue with defining new types. The change is purely a coding
      style change which should have no impact on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2102bc3
    • John Whitmore's avatar
      staging:rtl8192u: Remove typedef of cmpk_intr_sta_t - Style · 17a16b76
      John Whitmore authored
      Remove the typedef of struct cmpk_intr_sta_t, the name of the structure
      has been left as cmd_pkt_interrupt_status. This clears the checkpatch
      issue with creating new types in code. The change is purely a coding
      style change and should have no impact on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17a16b76
    • John Whitmore's avatar
      staging:rtl8192u: Correct spelling in comments - style · 9989b9d1
      John Whitmore authored
      Correct the spelling of a number of comments, which cause a checkpatch
      issue. This is purely a coding style change which should have no impact
      on runtime code execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9989b9d1
    • John Whitmore's avatar
      staging:rtl8192u: Removed unused CMPK_RX_DBG_MSG_SIZE - Style · 171b51a9
      John Whitmore authored
      Remove the unused macro definition CMPK_RX_DBG_MSG_SIZE. This is a
      coding style change which should have no impact on runtime code
      execution.
      Signed-off-by: default avatarJohn Whitmore <johnfwhitmore@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      171b51a9