Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
	"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
	"Tobias Sperling" <tobias.sperling@softing.com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"Trevor Gamblin" <tgamblin@baylibre.com>,
	"Esteban Blanc" <eblanc@baylibre.com>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Ramona Alexandra Nechita" <ramona.nechita@analog.com>,
	"Eason Yang" <j2anfernee@gmail.com>,
	"Pop Ioan Daniel" <pop.ioan-daniel@analog.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH v2 2/3] iio: adc: Support ROHM BD79112 ADC/GPIO
Date: Sun, 7 Sep 2025 12:16:47 +0100	[thread overview]
Message-ID: <20250907121647.425fb8d1@jic23-huawei> (raw)
In-Reply-To: <796291b5-f61a-4d68-9cbb-ae099dbb93d8@gmail.com>


> >> +/* ADC channels as named in the data-sheet */
> >> +static const char * const bd79112_chan_names[] = {
> >> +	"AGIO0A", "AGIO1A", "AGIO2A", "AGIO3A", "AGIO4A",	/* 0 - 4 */
> >> +	"AGIO5A", "AGIO6A", "AGIO7A", "AGIO8A", "AGIO9A",	/* 5 - 9 */
> >> +	"AGIO10A", "AGIO11A", "AGIO12A", "AGIO13A", "AGIO14A",	/* 10 - 14 */
> >> +	"AGIO15A", "AGIO0B", "AGIO1B", "AGIO2B", "AGIO3B",	/* 15 - 19 */
> >> +	"AGIO4B", "AGIO5B", "AGIO6B", "AGIO7B", "AGIO8B",	/* 20 - 24 */
> >> +	"AGIO9B", "AGIO10B", "AGIO11B", "AGIO12B", "AGIO13B",	/* 25 - 29 */
> >> +	"AGIO14B", "AGIO15B",					/* 30 - 31 */  
> > 
> > O-o-key, but why not power-of-two per line (esp. taking into account
> > the whole size)? (Whatever, it's not something I would fight for.)  
> 
> I just filled the rows to the maximum width, while keeping the item 
> count same for each row and adding the comment.
> 
> I'm not really sure having 4 items / row, and adding one row more would 
> be much better, but not much worse either. I can do this if you think 
> it's better. (No need to even fight for that).

In this case I'd do it in 4s purely because then the B ones start on
a new line and that looks nicer ;)

> 
> >> +};  
> > 
> > ...
> >   
> >> +	data->vref_mv = ret / 1000;  
> > 
> > Yeah, mV, (MICRO / MILLI) and other things I leave to other people to discuss.  
> 
> Thanks Andy. I've a feeling we were somewhat stuck on this discussion 
> anyways. I suppose it's nice to hear other's opinions if someone else 
> really cares. This was approaching bikeshedding.
> 
I'll just throw a quick comment in here.  

I'm absolutely in favour of the defines as they help in several ways.
- Stop counting 0s when there are lots of them. 
- Provide information on the unit conversion not otherwise visible
  where they happen to be used (often avoids need for local variables etc).
- Consistency across a code base.

In this particular case none apply strongly enough to force the issue.
Even so I'd prefer the units.h macros are used for the consistency reason
but I won't refuse to merge the driver over this.

One of those perfect (to me) being the enemy of good cases.

p.s. Matti, 3 versions in 4 days?  Perhaps slow down a little.

  parent reply	other threads:[~2025-09-07 11:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-04 12:35 [PATCH v2 0/3] Support ROHM BD79112 ADC Matti Vaittinen
2025-09-04 12:36 ` [PATCH v2 1/3] dt-bindings: iio: adc: ROHM BD79112 ADC/GPIO Matti Vaittinen
2025-09-04 19:24   ` Conor Dooley
2025-09-04 12:36 ` [PATCH v2 2/3] iio: adc: Support " Matti Vaittinen
2025-09-04 13:36   ` Andy Shevchenko
2025-09-05  5:41     ` Matti Vaittinen
2025-09-05 13:18       ` David Lechner
2025-09-07 12:41         ` Matti Vaittinen
2025-09-07 11:16       ` Jonathan Cameron [this message]
2025-09-08  5:07         ` Matti Vaittinen
2025-09-04 12:37 ` [PATCH v2 3/3] MAINTAINERS: Support ROHM BD79112 ADC 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=20250907121647.425fb8d1@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=eblanc@baylibre.com \
    --cc=herve.codina@bootlin.com \
    --cc=j2anfernee@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=pop.ioan-daniel@analog.com \
    --cc=ramona.nechita@analog.com \
    --cc=robh@kernel.org \
    --cc=tgamblin@baylibre.com \
    --cc=tobias.sperling@softing.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