Re: [PATCH 15/21] thermal: cooling: avoid uninitialied used gcc warning

From: Arnd Bergmann
Date: Thu Apr 25 2013 - 17:09:54 EST


On Thursday 25 April 2013, edubezval@xxxxxxxxx wrote:
> Rui has merged a patch that removes this bogus compiler warning:
> http://git.kernel.org/cgit/linux/kernel/git/rzhang/linux.git/commit/?h=next&id=4469b99743d296e24aefc5f8ed7df1bc9cfbbac8
>
> Though, as not as elegant as your patch, it does the trick. :-)

Ok, works for me.

Looking at the patch however tells me that it has the potential to hide real
bugs if the code is ever changed to actually do an uninitialized access.
It's not very likely in this case, but I generally recommend not to add
any variables at declaration time unless the initialization is to a
meaningful value that the code later uses.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/