Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rodrigo Alencar" <rodrigo.alencar@analog.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 5/8] iio: dac: ad5686: implement new sync() op for the spi bus
Date: Thu, 16 Jul 2026 12:32:21 +0000	[thread overview]
Message-ID: <20260716123221.E37681F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260716-ad5686-new-features-v8-5-ebb0051af5e5@analog.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Use of the C++ / C23 `auto` keyword for type inference causes a compilation error in standard Linux kernel C.
--

--- Patch [5]: [PATCH v8 5/8] iio: dac: ad5686: implement new sync() op for the spi bus ---
commit 6524307465bd775ca4dd7375ae2bb7b554ff6dde
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>

iio: dac: ad5686: implement new sync() op for the spi bus

This commit introduces a new sync() operation for the SPI bus to handle
multiple channel DAC writes more efficiently. It stores SPI transfers in
a message and flushes them to the platform driver during the sync operation.

> diff --git a/drivers/iio/dac/ad5686-spi.c b/drivers/iio/dac/ad5686-spi.c
> index d3b64b4361d51..2cb836038821f 100644
> --- a/drivers/iio/dac/ad5686-spi.c
> +++ b/drivers/iio/dac/ad5686-spi.c
[ ... ]
> @@ -13,59 +13,101 @@
>  static int ad5686_spi_write(struct ad5686_state *st,
>  			    u8 cmd, u8 addr, u16 val)
>  {
> -	struct spi_device *spi = to_spi_device(st->dev);
> -	u8 tx_len, *buf;
> -
> +	struct ad5686_spi_data *bus_data = st->bus_data;
> +	struct spi_transfer *xfer;
> +
> +	if (bus_data->size >= bus_data->capacity)
> +		return -E2BIG;
> +
> +	/*
> +	 * This function stores spi transfers to a spi message to be sent over
> +	 * the bus when sync() op is called. If there are already transfers in
> +	 * the spi message, set the cs_change flag on the last transfer to
> +	 * ensure that the chip select is deasserted between transfers. If this
> +	 * is the first transfer, initialize the spi message. Later on, the
> +	 * current transfer is added to the message with spi_message_add_tail().
> +	 */
> +	if (bus_data->size)
> +		bus_data->xfers[bus_data->size - 1].cs_change = 1;
> +	else
> +		spi_message_init(&bus_data->msg);
> +
> +	xfer = &bus_data->xfers[bus_data->size];
> +	auto buf = &st->data[bus_data->size];

[Severity: Low]
Will this cause a compilation error? Standard GNU C11 used in the Linux kernel
does not support the C++ or C23 auto keyword for type deduction.

>  	switch (st->chip_info->regmap_type) {
>  	case AD5310_REGMAP:

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260716-ad5686-new-features-v8-0-ebb0051af5e5@analog.com?part=5

  reply	other threads:[~2026-07-16 12:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 12:14 [PATCH v8 0/8] New features for the AD5686 IIO driver Rodrigo Alencar via B4 Relay
2026-07-16 12:14 ` [PATCH v8 1/8] iio: dac: ad5696: properly check i2c_transfer() return value Rodrigo Alencar via B4 Relay
2026-07-16 12:28   ` sashiko-bot
2026-07-16 12:14 ` [PATCH v8 2/8] iio: dac: ad5686: missing NULL check on match data Rodrigo Alencar via B4 Relay
2026-07-16 12:27   ` sashiko-bot
2026-07-16 13:05   ` Joshua Crofts
2026-07-16 12:14 ` [PATCH v8 3/8] iio: dac: ad5686: refactor command/data macros Rodrigo Alencar via B4 Relay
2026-07-16 12:14 ` [PATCH v8 4/8] iio: dac: ad5686: introduce sync operation Rodrigo Alencar via B4 Relay
2026-07-16 12:14 ` [PATCH v8 5/8] iio: dac: ad5686: implement new sync() op for the spi bus Rodrigo Alencar via B4 Relay
2026-07-16 12:32   ` sashiko-bot [this message]
2026-07-16 12:14 ` [PATCH v8 6/8] iio: dac: ad5686: read_raw/write_raw: use guard(mutex)() Rodrigo Alencar via B4 Relay
2026-07-16 12:14 ` [PATCH v8 7/8] iio: dac: ad5686: add triggered buffer support Rodrigo Alencar via B4 Relay
2026-07-16 12:14 ` [PATCH v8 8/8] iio: dac: ad5686: add gain control support Rodrigo Alencar via B4 Relay

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=20260716123221.E37681F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=rodrigo.alencar@analog.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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