Re: [PATCH] USB: serial: ftdi_sio: fix format specifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux