Re: [PATCH 2/2] regmap: fix return of uninitialized value

From: Mark Brown
Date: Sat Jun 01 2013 - 14:52:25 EST


On Thu, May 30, 2013 at 09:54:02PM +0530, Vinod Koul wrote:

> struct regmap_debugfs_off_cache *c = NULL;
> loff_t p = 0;
> - unsigned int i, ret;
> + unsigned int i, ret = 0;

Two problems here. One is that we shouldn't mix initialised and
non-initialised declarations on one line and the other is that just
squashing a value in isn't a great fix for this sort of thing - it's
just shutting the warning up but perhaps the compiler has actually
spotted some control flow error and there's more wrong than just a
missing initialisation.

Attachment: signature.asc
Description: Digital signature