Skip to content
  • Nishka Dasgupta's avatar
    6ef7eef9
    staging: ks7010: Merge multiple return variables in ks_hostif.c · 6ef7eef9
    Nishka Dasgupta authored
    
    
    The function hostif_data_request had two return variables, ret and
    result. When ret is assigned a value, in all cases (except one) this
    assignment is followed immediately by a goto to the end of the
    function. In the last case, the goto takes effect only if ret < 0;
    however, if ret >= 0 then this value of ret is not needed in the
    remainder of that branch. On the other hand result is used (assigned a
    value and returned) only in those branches where ret >= 0 or ret has
    not been used at all.
    As the values of ret and result are not both required at the same point
    in any branch, result can be removed and its occurrences replaced with
    ret.
    
    Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    6ef7eef9
    staging: ks7010: Merge multiple return variables in ks_hostif.c
    Nishka Dasgupta authored
    
    
    The function hostif_data_request had two return variables, ret and
    result. When ret is assigned a value, in all cases (except one) this
    assignment is followed immediately by a goto to the end of the
    function. In the last case, the goto takes effect only if ret < 0;
    however, if ret >= 0 then this value of ret is not needed in the
    remainder of that branch. On the other hand result is used (assigned a
    value and returned) only in those branches where ret >= 0 or ret has
    not been used at all.
    As the values of ret and result are not both required at the same point
    in any branch, result can be removed and its occurrences replaced with
    ret.
    
    Signed-off-by: default avatarNishka Dasgupta <nishkadg.linux@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading