Re: [PATCH] fix build waring: drivers/regulator/core.c: warning: âvalâ may be used uninitialized in this function [-Wuninitialized]

From: Mark Brown
Date: Fri Nov 09 2012 - 06:03:20 EST


On Fri, Nov 09, 2012 at 05:29:40PM +0800, helight wrote:

> - unsigned int val;
> int ret;
> + unsigned int val = 0;

This sort of change is really not at all helpful, we should be making
sure that whatever path should be initialising the value but isn't does
so, just initialising at declaration means that if the compiler has
spotted a genuine error we won't fix it.

Attachment: signature.asc
Description: Digital signature