[alsa-devel] [PATCH 2/2] ASoC: Fix 'may be used uninitialized' warnings

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Dec 27 17:42:51 CET 2012

On Mon, Dec 24, 2012 at 03:55:38PM -0200, Fabio Estevam wrote:

> -	u16 reg_l, reg_r, dcs_cfg, dcs_reg;
> +	u16 reg_l = 0, reg_r = 0, dcs_cfg, dcs_reg;

No, this is a terrible idea.  Apart from the coding style thing all
you're doing here is just ensuring that a value is set in the variable
without any analysis saying that this is a sensible value to set or that
the compiler hasn't spotted a genuine issue.

There's also the possibility that the compiler is just buggy...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20121227/de6b9d98/attachment.sig>

More information about the Alsa-devel mailing list