[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdAEefH5Vgk5BZz8vGDXyu0EmEy3hwoeRDJsKmkjaQW9w@mail.gmail.com>
Date: Mon, 28 Apr 2025 12:49:39 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Matti Vaittinen <mazziesaccount@...il.com>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>, Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: ti-adc128s052: Drop variable vref
On Mon, Apr 28, 2025 at 12:45 PM Matti Vaittinen
<mazziesaccount@...il.com> wrote:
> On 28/04/2025 10:08, Andy Shevchenko wrote:
> > On Mon, Apr 28, 2025 at 10:02 AM Matti Vaittinen
> > <mazziesaccount@...il.com> wrote:
...
> >> + int vref_mv;
> >
> > vref_mV please. And yes, I know historical and other reasons for them
> > all being small, but let's try to be more scientific in these crazy
> > days.
>
> Sorry Andy but I see zero reason to use capital letters here. In my
> opinion, this is perfectly clear as it is. Capital letters in variables
> are ugly (to me) and absolutely not needed to explain the meaning.
And I see zero reason to not use the correct scientific unitis there.
Note, that regulator framework and some other drivers are using that
and I consider this is the correct way to go.
...
> > Or actually a time to introduce MILLIVOLT_PER_VOLT in units.h ?
>
> I really fail to see the benefit. Do you think we should add
> MILLIx_PER_x for each unit we can imagine/use?
>
> That doesn't really scale or make sense to me. We have MILLI. It does
> not really matter if it is volts, amps, ohms or horse heads - it's still
> 1000. It just gets cumbersome to search the headers to see if we have
> some fancy define for unit we have at our hands.
In some contexts this gives the understanding of the units and how big
the value is. Even with some defined constants it's not possible to
describe in their names everything that this definition adds. I do see
a benefit of it.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists