All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Antoniu Miclaus" <antoniu.miclaus@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.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>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] iio: amplifiers: adl8113: add driver support
Date: Sat, 6 Dec 2025 22:48:19 +0200	[thread overview]
Message-ID: <aTSWk_p62hJBKCtN@smile.fi.intel.com> (raw)
In-Reply-To: <20251206190332.53874d41@jic23-huawei>

On Sat, Dec 06, 2025 at 07:03:32PM +0000, Jonathan Cameron wrote:
> On Fri, 5 Dec 2025 16:40:41 +0200
> Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

...

> > +	/* Always include internal amplifier (14dB) */
> > +	st->gain_configs[i].path = ADL8113_INTERNAL_AMP;
> > +	st->gain_configs[i].gain_db = 14;
> 
> Could do this as something like:

I remember a discussion where it was against this approach due to compiler
warnings or so. However, IIRC, there was slightly different pattern, i.e.

	foo[i].bar = ...
	foo[i++].baz = ...

That said, I have no objection to your proposal, but we need to use it with
a good compile test coverage (clang with `make W=1` for a starter.

OTOH, the original code is robust enough...

> 	st->gain_configs[i++] = (struct adl8113_gain_config) {
> 		.path = ADL8113_INTERNAL_AMP,
> 		.gain_db = 14,
> 	};

...and doesn't require a good understanding of differences between designated
initialisers and compound literals.

> 	st->gain_configs[i++] = (struct adl8113_gain_config) {
> 		.path = ADL8113_INTERNAL_BYPASS,
> 		.gain_db = -2,
> 	};


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-12-06 20:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 14:40 [PATCH v6 0/2] iio: amplifiers: add support for ADL8113 Low Noise Amplifier Antoniu Miclaus
2025-12-05 14:40 ` [PATCH v6 1/2] dt-bindings: iio: amplifiers: add adl8113 Antoniu Miclaus
2025-12-06 18:50   ` Jonathan Cameron
2025-12-09 20:51   ` Rob Herring (Arm)
2025-12-05 14:40 ` [PATCH v6 2/2] iio: amplifiers: adl8113: add driver support Antoniu Miclaus
2025-12-05 15:10   ` Andy Shevchenko
2025-12-06 19:03   ` Jonathan Cameron
2025-12-06 20:48     ` Andy Shevchenko [this message]
2025-12-07 12:52       ` Jonathan Cameron
2025-12-12 10:41     ` Miclaus, Antoniu
2025-12-13 16:26       ` Jonathan Cameron

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=aTSWk_p62hJBKCtN@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.