Re: [PATCH 1/2] i2c: designware: determine HS tHIGH and tLOW based on HW paramters

From: Andy Shevchenko
Date: Thu Sep 26 2024 - 08:18:42 EST


On Thu, Sep 26, 2024 at 08:45:47AM +0000, Michael Wu wrote:
> > On Wed, Sep 25, 2024 at 12:16:10PM +0300, Andy Shevchenko wrote:
> > > On Wed, Sep 25, 2024 at 04:04:30PM +0800, Michael Wu wrote:

...

> > > > + * @bus_loading: for high speed mode, the bus loading affects the high
> > and low
> > > > + * pulse width of SCL
> > >
> > > This is bad naming, better is bus_capacitance.
> >
> > Even more specific bus_capacitance_pf as we usually add physical units to the
> > variable names, so we immediately understand from the code the order of
> > numbers and their physical meanings.
>
> Sounds good. However, I think the length of "bus_capacitance_pf" is a bit
> long, we may often encounter the limit of more than 80 characters in a
> line when coding. I'll rename it to "bus_cap_pf".

Limit had been relaxed to 100. I still think we may use temporary variables,
if needed, in order to make code neater. That said, I slightly prefer
bus_capacitance_pf over the shortened variant.

--
With Best Regards,
Andy Shevchenko