[PATCH] spi: aspeed: Replace VLA parameter with flat pointer in calibration helper

Mark Brown broonie at kernel.org
Wed May 20 03:10:41 PDT 2026


On Tue, May 19, 2026 at 06:13:48PM +0100, David Laight wrote:
> Mark Brown <broonie at kernel.org> wrote:
> > On Mon, May 18, 2026 at 05:57:08PM +0800, Chin-Ting Kuo wrote:

> > > -			while (k < cols && buf[i][k])
> > > +			while (k < cols && buf[i * cols + k])  

> > This really needs () to make it clear what's going on; the precedence is
> > well defined but not everyone is going to know that off the top of their
> > head.

> Come on, it's multiply and add - everyone is going to get that right.

No, I have to stop and think.  It's not just "what is the rule" it's
also "is that the same rule whoever wrote the code thought there was" -
implicit precedence is the sort of thing that flags up as an alarm bell
when scanning through code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260520/83365cf5/attachment.sig>


More information about the linux-arm-kernel mailing list