Re: [PATCH v7 4/7] iio: dac: ad5686: implement new sync() op for the spi bus

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-hardening,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
On Mon, Jul 13, 2026 at 05:44:28PM +0100, Rodrigo Alencar wrote:
> On 11/07/26 10:07, David Lechner wrote:
> > On 7/10/26 6:20 AM, Rodrigo Alencar via B4 Relay wrote:

...

> > > +	if (bus_data->size >= bus_data->capacity)
> > > +		return -E2BIG;
> > > +
> > > +	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];
> > 
> > Why not a local variable for st->data[bus_data->size] too so we don't
> > have to write it so many times?
> 
> The union is anonymous.. is it fine to use:
> 
> 	typeof(st->data[0]) *buf;

*If* you will go this way, use 'auto' keyword instead of typeof().

> 	...
> 	buf = &st->data[bus_data->size];

-- 
With Best Regards,
Andy Shevchenko
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.