usb: clean up some of the computations in adu_read
authorDaniel M German <dmg@turingmachine.org>
Fri, 21 Jun 2019 15:22:40 +0000 (08:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2019 16:01:09 +0000 (18:01 +0200)
commit4850f26abfcac9ed28a4db5817b46dc0bfbbbae0
treea4e92bdb6e25792ae82d4339dde18567a73d62c8
parent235e6e0a8d5fd1d0285a8d13fbaa3b92112b877a
usb: clean up some of the computations in adu_read

Replace ?: with min to calculate the number of bytes in the secondary buffer,
including changing the data type of data_in_secondary to size_t to be
type-consistent. data_in_secondary can never be negative.

Remove some spurious calculations (copy_to_user returns zero on success),
making one variable redundant (i)

This change does not alter the functionality of the code.

Signed-off-by: Daniel M German <dmg@turingmachine.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/adutux.c