usb: storage: realtek_cr: Simplify residue calculation in rts51x_bulk_transport()
Subsystems (2)
PATCH RESEND 1/1 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.
--- drivers/usb/storage/realtek_cr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/storage/realtek_cr.c +2 -2
@@ -261,8 +261,8 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun,* try to compute the actual residue, based on how much data * was really transferred and what the device tells us */ -if (residue) - residue = residue < buf_len ? residue : buf_len; +if (residue > buf_len) + residue = buf_len;if (act_len) *act_len = buf_len - residue;
Signature · 1 line
2.50.1
Greg Kroah-Hartman
maintainerQuoted 28 lines · Thorsten Blum
Simplify the calculation of 'residue' in
rts51x_bulk_transport()and avoid unnecessarily reassigning 'residue' to itself.Acked-by Alan Stern <[email protected]>Signed-off-by Thorsten Blum <[email protected]>--- drivers/usb/storage/realtek_cr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/storage/realtek_cr.c +2
-2@@ -261,8 +261,8 @@ static int rts51x_bulk_transport(struct us_data *us, u8 lun,* try to compute the actual residue, based on how much data * was really transferred and what the device tells us */ -if (residue) - residue = residue < buf_len ? residue : buf_len; +if (residue > buf_len) + residue = buf_len;if (act_len) *act_len = buf_len - residue;Signature · 1 line
2.50.1
Why is this a RESEND? What happened to the first one?
thanks,
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Thorsten Blum
Simplify the calculation of 'residue' in
rts51x_bulk_transport()and avoid unnecessarily reassigning 'residue' to itself.Acked-by Alan Stern <[email protected]>Signed-off-by Thorsten Blum <[email protected]>---
Why is this a RESEND? What happened to the first one?
This was patch 2/3 of a patch series that doesn't apply anymore because you asked me to submit the bugfix in patch 3/3 separately [1].
Since the series doesn't apply anymore and patch 1/3 didn't get any support [2], I figured it's best to resend this one as a separate patch.
Thanks,
Thorsten
[1] https://lore.kernel.org/lkml/2025081358-posted-ritzy-bd3f@gregkh/
[2] https://lore.kernel.org/lkml/[email protected]/
Greg Kroah-Hartman
maintainerQuoted 13 lines · Thorsten Blum
Quoted 8 lines · Greg Kroah-Hartman
Quoted 6 lines · Thorsten Blum
Simplify the calculation of 'residue' in
rts51x_bulk_transport()and avoid unnecessarily reassigning 'residue' to itself.Acked-by Alan Stern <[email protected]>Signed-off-by Thorsten Blum <[email protected]>---
Why is this a RESEND? What happened to the first one?
This was patch 2/3 of a patch series that doesn't apply anymore because you asked me to submit the bugfix in patch 3/3 separately [1].
Quoted 9 lines
Since the series doesn't apply anymore and patch 1/3 didn't get any support [2], I figured it's best to resend this one as a separate patch.
Thanks,
Thorsten[1] https://lore.kernel.org/lkml/2025081358-posted-ritzy-bd3f@gregkh/
[2] https://lore.kernel.org/lkml/[email protected]/
Ah, that's better, you should have put that below the --- line to make it more obvious as I didn't remember that at all :)
thanks,
greg k-h