Re: [PATCH v2 7/7] USB: serial: ftdi_sio: Fill c_*speed fields with real baud rate

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

 



On Tue, Sep 13, 2022 at 05:24:05PM +0200, Pali Rohár wrote:
> On Tuesday 13 September 2022 17:02:39 Johan Hovold wrote:
> > On Thu, Aug 18, 2022 at 04:17:38PM +0200, Pali Rohár wrote:
> > > On Sunday 24 July 2022 14:41:19 Johan Hovold wrote:

> > > > >  static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
> > > > >  {
> > > > >  	unsigned short int divisor;
> > > > > @@ -1189,15 +1206,33 @@ static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
> > > > >  	return divisor;
> > > > >  }
> > > > >  
> > > > > +static int ftdi_232am_divisor_base_to_baud(unsigned short int divisor, int base)
> > > > 
> > > > I believe "base" was used as a function name suffix in the inverse
> > > > function (due to the additional base argument).
> > > 
> > > Yes, in the same way as it used in name of ftdi_232am_baud_base_to_divisor.
> > 
> > No, you used "base" as an infix here.

> Yes, of course, it is "in the middle" because I said I used it in the
> same way as in ftdi_232am_baud_base_to_divisor.
> 
> ftdi_232am_baud_base_to_divisor converts input "baud" and input "base"
> to return "divisor". Hence baud_base_to_divisor.
> 
> And so ftdi_232am_divisor_base_to_baud converts input "divisor" and
> input "base" to return value "baud". Hence divisor_base_to_baud.
> 
> So what is the problem? I still have not caught.

Ok, I should have looked closer at the code before replying.

I believe I expected "base" to be used as a suffix in the current code
but that doesn't appear to be the case. So you're just following the
current style.

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