* [PATCH] USB: serial: ftdi_sio: fix format specifier
@ 2022-04-26 12:37 Daniels Umanovskis
2022-05-05 12:17 ` Johan Hovold
0 siblings, 1 reply; 2+ messages in thread
From: Daniels Umanovskis @ 2022-04-26 12:37 UTC (permalink / raw)
To: johan, linux-usb; +Cc: Daniels Umanovskis
The latency is an unsigned int and should be printed as such
Signed-off-by: Daniels Umanovskis <du@axentia.se>
---
drivers/usb/serial/ftdi_sio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 49c08f07c969..b440d338a895 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1671,7 +1671,7 @@ static ssize_t latency_timer_show(struct device *dev,
if (priv->flags & ASYNC_LOW_LATENCY)
return sprintf(buf, "1\n");
else
- return sprintf(buf, "%i\n", priv->latency);
+ return sprintf(buf, "%u\n", priv->latency);
}
/* Write a new value of the latency timer, in units of milliseconds. */
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] USB: serial: ftdi_sio: fix format specifier
2022-04-26 12:37 [PATCH] USB: serial: ftdi_sio: fix format specifier Daniels Umanovskis
@ 2022-05-05 12:17 ` Johan Hovold
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2022-05-05 12:17 UTC (permalink / raw)
To: Daniels Umanovskis; +Cc: linux-usb
On Tue, Apr 26, 2022 at 12:37:35PM +0000, Daniels Umanovskis wrote:
> The latency is an unsigned int and should be printed as such
>
> Signed-off-by: Daniels Umanovskis <du@axentia.se>
> ---
> drivers/usb/serial/ftdi_sio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
> index 49c08f07c969..b440d338a895 100644
> --- a/drivers/usb/serial/ftdi_sio.c
> +++ b/drivers/usb/serial/ftdi_sio.c
> @@ -1671,7 +1671,7 @@ static ssize_t latency_timer_show(struct device *dev,
> if (priv->flags & ASYNC_LOW_LATENCY)
> return sprintf(buf, "1\n");
> else
> - return sprintf(buf, "%i\n", priv->latency);
> + return sprintf(buf, "%u\n", priv->latency);
> }
>
> /* Write a new value of the latency timer, in units of milliseconds. */
While latency is indeed an unsigned int it only holds values in the
range 0..255.
Applied with an amended commit:
https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/commit/?h=usb-next
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-05 12:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 12:37 [PATCH] USB: serial: ftdi_sio: fix format specifier Daniels Umanovskis
2022-05-05 12:17 ` Johan Hovold
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.