From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: ti-adc128s052: Drop variable vref
Date: Mon, 28 Apr 2025 16:10:47 +0300 [thread overview]
Message-ID: <e0f8a39e-195d-4b72-8787-36769c1e62c8@gmail.com> (raw)
In-Reply-To: <CAHp75VdAEefH5Vgk5BZz8vGDXyu0EmEy3hwoeRDJsKmkjaQW9w@mail.gmail.com>
On 28/04/2025 12:49, Andy Shevchenko wrote:
> On Mon, Apr 28, 2025 at 12:45 PM Matti Vaittinen
> <mazziesaccount@gmail.com> wrote:
>> On 28/04/2025 10:08, Andy Shevchenko wrote:
>>> On Mon, Apr 28, 2025 at 10:02 AM Matti Vaittinen
>>> <mazziesaccount@gmail.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.
I find this ridiculous reason. There is zero confusion what the vref_mv
stands for, and I prefer variables in lower case.
> Note, that regulator framework
Actually, the regulator framework uses _both_ lower and upper case in
some places, and I believe the reason is that bikeshedding over the
capitalization isn't Mark's cup of tea.
> 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.
You can suggest adding it if you wish. I still find it silly as I don't
see why one wouldn't then end up adding base SI units too.
MILLIVOLT_PER_VOLT
MILLIKILOGRAM_PER_KILOGRAM
MILLIMETER_PER_METER
MILLISECOND_PER_SECON
MILLIAMPERE_PER_AMPERE
MILLIKELVIN_PER_KELVIN
MILLIMOLE_PER_MOLE
MILLICANDELA_PER_CANDELA
Oh, and because Volt is added, then also:
Newton, Heryz, Coulomb, Henry, Farad, Ohm, Siemens, Weber, Tesla, Joule,
Watt, Radian, Bequerel and Lumen.
And, sure adding Kelvin warrants adding Celsius and Fahrenheit. Oh,
probably also imperial units, right?
All being the same MILLI.
No thanks. I am opposing this as it will only make life of a code writer
(and maybe also reader) harder. I'm not suggesting a patch adding
something I feel is rather silly.
Yours,
-- Matti
next prev parent reply other threads:[~2025-04-28 13:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 7:02 [PATCH] iio: ti-adc128s052: Drop variable vref Matti Vaittinen
2025-04-28 7:08 ` Andy Shevchenko
2025-04-28 9:45 ` Matti Vaittinen
2025-04-28 9:49 ` Andy Shevchenko
2025-04-28 13:10 ` Matti Vaittinen [this message]
2025-05-05 16:31 ` Jonathan Cameron
2025-04-28 15:16 ` David Lechner
2025-04-29 4:10 ` Matti Vaittinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e0f8a39e-195d-4b72-8787-36769c1e62c8@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox