Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sdhci: 'scratch' may be used uninitialized

The variable 'scratch' is always initialized before it's used. The
conditional which is responsible for initialization of 'scratch' will
always evaluate 'true' when the first loop iteration occurs, and thus,
it's properly initialized. GCC doesn't see this, of course, so using
the uninitialized_var() macro seems to work for silencing this case.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

authored by

Steven Noonan and committed by
Pierre Ossman
7244b85b 57105737

+1 -1
+1 -1
drivers/mmc/host/sdhci.c
··· 177 177 { 178 178 unsigned long flags; 179 179 size_t blksize, len, chunk; 180 - u32 scratch; 180 + u32 uninitialized_var(scratch); 181 181 u8 *buf; 182 182 183 183 DBG("PIO reading\n");