Re: [PATCH] spi: aspeed: Replace VLA parameter with flat pointer in calibration helper
Mark Brown <[email protected]>
| Newsgroups | org.ozlabs.lists.openbmc,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-spi,org.ozlabs.lists.linux-aspeed |
|---|---|
| Message-ID | <[email protected]> |
On Tue, May 19, 2026 at 06:13:48PM +0100, David Laight wrote: > Mark Brown <[email protected]> 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.
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmoNiKAACgkQJNaLcl1U h9BIxQf9HkMWU0/J36NRwMFjRutEI7x1P5sg8Sloy12eLKK6LBY1hzsPKyZ4ZaIw vVtbThixSNpcSL6oBndIVKdvWoWyYT/o3x2bfTnzKHbdKT5Ok9heXD6aSc/f1ck4 k0Xp0kN9MptpXrEEVBr15nBjhkUOOyFVnlsFotYE9TBzhGWBWxJrQrK1w+eBYu6r MEd0mR0/FfuUwFm27aMR6Ur33GRUPs/pVN5/2ndfNGwtIXrjKICYIQ5/lJyONp+5 nCIorPasL6Yywp5B6+p492omJxkuUpkq3EhWhwowOwTD/zlpnglzkNyVuIp3E3Wf jyCptDj/7h3ujYiwLZ80EgTAcxFF4A== =pk4f -----END PGP SIGNATURE-----