Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: storage: realtek_cr: Simplify residue calculation in rts51x_bulk_transport()

Simplify the calculation of 'residue' in rts51x_bulk_transport() and
avoid unnecessarily reassigning 'residue' to itself.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250828162623.4840-3-thorsten.blum@linux.dev
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thorsten Blum and committed by
Greg Kroah-Hartman
5195edb3 811ee632

+2 -2
+2 -2
drivers/usb/storage/realtek_cr.c
··· 260 260 * try to compute the actual residue, based on how much data 261 261 * was really transferred and what the device tells us 262 262 */ 263 - if (residue) 264 - residue = residue < buf_len ? residue : buf_len; 263 + if (residue > buf_len) 264 + residue = buf_len; 265 265 266 266 if (act_len) 267 267 *act_len = buf_len - residue;