Re: [PATCH 5/7] USB: serial: ftdi_sio: Fix baudrate rounding for ASYNC_SPD_CUST

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

 



On Thu, 7 Jul 2022 17:11:00 +0200
Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

> On Thu, Jul 07, 2022 at 04:53:52PM +0200, Marek Behún wrote:
> > From: Pali Rohár <pali@xxxxxxxxxx>
> > 
> > Use DIV_ROUND_CLOSEST() for more accurate baudrate calculation for
> > ASYNC_SPD_CUST instead of rounding it just down.  
> 
> Why?  What does this change or fix?

To compute more accurate baudrate when given custom divisor.

User requests a baudrate B.
Application uses old API, so it computes divisor D for baudrate B.
The driver then tries to compute back the requested baudrate B. To
compute it back more accurately, rounding to closes value should be
used.

Marek





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux