* [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str()
@ 2026-07-16 19:04 David Cusimano
2026-07-17 4:43 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: David Cusimano @ 2026-07-16 19:04 UTC (permalink / raw)
To: linux-usb; +Cc: linux-kernel, gregkh
From 73039aaf92449baf12dd4f774164cab4b9987a5c Mon Sep 17 00:00:00 2001
From: David Cusimano <david@cusimano.com>
Date: Thu, 16 Jul 2026 14:04:29 -0400
Subject: [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str()
The ndecimals parameter controls how many decimal places are added when the
expected suffix is missing. It is never used as a signed quantity, so make
it
unsigned to better reflect its intended semantics.
Signed-off-by: David Cusimano <david@cusimano.com>
---
drivers/usb/storage/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 064c7fc8e..c5bfedce7 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -83,7 +83,7 @@ static unsigned int delay_use = 1 * MSEC_PER_SEC;
*
* Returns 0 on success, a negative error code otherwise.
*/
-static int parse_delay_str(const char *str, int ndecimals, const char
*suffix,
+static int parse_delay_str(const char *str, unsigned int ndecimals, const
char *suffix,
unsigned int *val)
{
int n, n2, l;
--
2.50.1 (Apple Git-155)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str()
2026-07-16 19:04 [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str() David Cusimano
@ 2026-07-17 4:43 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-07-17 4:43 UTC (permalink / raw)
To: David Cusimano; +Cc: linux-usb, linux-kernel
On Thu, Jul 16, 2026 at 03:04:00PM -0400, David Cusimano wrote:
> >From 73039aaf92449baf12dd4f774164cab4b9987a5c Mon Sep 17 00:00:00 2001
> From: David Cusimano <david@cusimano.com>
> Date: Thu, 16 Jul 2026 14:04:29 -0400
> Subject: [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str()
Something went really wrong with your email system, this shouldn't be
here, and your patch is corrupted :(
>
> The ndecimals parameter controls how many decimal places are added when the
> expected suffix is missing. It is never used as a signed quantity, so make
> it
> unsigned to better reflect its intended semantics.
While nice, is this needed? Are you going to do this for all usages in
this file of the same thing?
We use "int" a lot in the kernel, so be aware that this is going to be
an interesting task, if not kind of pointless?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-17 4:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 19:04 [PATCH] usb: storage: make ndecimals unsigned in parse_delay_str() David Cusimano
2026-07-17 4:43 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox