[PATCH] ubifs: Fix build warning

Alexandre Pereira da Silva aletes.xgr at gmail.com
Mon Jun 25 14:23:53 EDT 2012


On Mon, Jun 25, 2012 at 1:15 PM, Randy Dunlap <rdunlap at xenotime.net> wrote:
> On 06/25/2012 08:19 AM, Alexandre Pereira da Silva wrote:
>
>> Fix:
>> fs/ubifs/dir.c: In function 'ubifs_rename':
>> fs/ubifs/dir.c:972:15: warning: 'saved_nlink' may be used uninitialized
>> in this function
>>
>> Initilize saved_nlink to 0
>
> Does nlink need to be init at all?  is the warning bogus or valid?

>From the code, this is a bogus warning.

> If the warning is bogus, the preferred solution is:
>
> #include <linux/compiler-gcc.h>
> ...
>        unsigned int uninitialized_var(nlink);

I will fix the patch as suggested. Thanks.



More information about the linux-mtd mailing list