[PATCH v8 4/9] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators

Mark Brown broonie at kernel.org
Tue Oct 14 05:35:11 PDT 2025


On Tue, Oct 14, 2025 at 01:35:37PM +0200, AngeloGioacchino Del Regno wrote:
> Il 09/10/25 16:41, Nicolas Frattaroli ha scritto:

> > Just initialise ret to 0 at the start of the function scope when
> > you declare it. You've already missed an uninitialised use once,
> > and playing these branch games is just asking for more trouble
> > in the future. There's no micro-optimisation you're doing here,
> > clang produces the same assembly for both zero initialised and
> > the else branch version you're doing here.

> It's not about micro-optimization. Double initialization is a bad coding practice.

Yes, if you just set the value at the start of the function then the
compiler won't be able to tell if you messed up the logic somewhere
later.  Sure, the warning is gone but that also includes cases where the
compiler is telling you about an actual problem.
-------------- 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-mediatek/attachments/20251014/b9eedde2/attachment.sig>


More information about the Linux-mediatek mailing list