Re: [PATCH] spi: aspeed: Replace VLA parameter with flat pointer in calibration helper
From: Mark Brown
Date: Wed May 20 2026 - 06:11:11 EST
On Tue, May 19, 2026 at 06:13:48PM +0100, David Laight wrote:
> Mark Brown <broonie@xxxxxxxxxx> 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.
Attachment:
signature.asc
Description: PGP signature