Linux USB
 help / color / mirror / Atom feed
* [PATCH 1/3] usb: storage: realtek_cr: Improve function parameter data types
@ 2025-08-13 10:12 Thorsten Blum
  2025-08-13 10:12 ` [PATCH 2/3] usb: storage: realtek_cr: Simplify residue calculation in rts51x_bulk_transport() Thorsten Blum
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Thorsten Blum @ 2025-08-13 10:12 UTC (permalink / raw)
  To: Alan Stern, Greg Kroah-Hartman
  Cc: Thorsten Blum, linux-usb, usb-storage, linux-kernel

In rts51x_bulk_transport() and rts51x_read_status(), change the function
parameters 'buf_len' and 'len' from 'int' to 'unsigned int' because
their values cannot be negative.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/usb/storage/realtek_cr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
index 7dea28c2b8ee..d2c3e3a39693 100644
--- a/drivers/usb/storage/realtek_cr.c
+++ b/drivers/usb/storage/realtek_cr.c
@@ -199,7 +199,8 @@ static const struct us_unusual_dev realtek_cr_unusual_dev_list[] = {
 #undef UNUSUAL_DEV
 
 static int rts51x_bulk_transport(struct us_data *us, u8 lun,
-				 u8 *cmd, int cmd_len, u8 *buf, int buf_len,
+				 u8 *cmd, int cmd_len, u8 *buf,
+				 unsigned int buf_len,
 				 enum dma_data_direction dir, int *act_len)
 {
 	struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *)us->iobuf;
@@ -417,7 +418,7 @@ static int rts51x_write_mem(struct us_data *us, u16 addr, u8 *data, u16 len)
 }
 
 static int rts51x_read_status(struct us_data *us,
-			      u8 lun, u8 *status, int len, int *actlen)
+			      u8 lun, u8 *status, unsigned int len, int *actlen)
 {
 	int retval;
 	u8 cmnd[12] = { 0 };
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-13 15:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 10:12 [PATCH 1/3] usb: storage: realtek_cr: Improve function parameter data types Thorsten Blum
2025-08-13 10:12 ` [PATCH 2/3] usb: storage: realtek_cr: Simplify residue calculation in rts51x_bulk_transport() Thorsten Blum
2025-08-13 14:00   ` Alan Stern
2025-08-13 10:12 ` [PATCH 3/3] usb: storage: realtek_cr: Use correct byte order for bcs->Residue Thorsten Blum
2025-08-13 14:00   ` Alan Stern
2025-08-13 14:39   ` Greg Kroah-Hartman
2025-08-13 14:57     ` Thorsten Blum
2025-08-13 13:59 ` [usb-storage] [PATCH 1/3] usb: storage: realtek_cr: Improve function parameter data types Alan Stern
2025-08-13 15:10   ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox