]> asedeno.scripts.mit.edu Git - linux.git/commit
staging: ks7010: Merge multiple return variables in ks_hostif.c
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Fri, 24 May 2019 08:18:21 +0000 (13:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2019 21:09:46 +0000 (14:09 -0700)
commit6ef7eef9291c5882dfbec34cc33257db4333912e
treed223682b0b2877d8727a4fd1ba20e4b7f12f2fb4
parenta7048b38ae443abe06141b75f842b73371c2a0fe
staging: ks7010: Merge multiple return variables in ks_hostif.c

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: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c