Skip to content

Commit

Permalink
sdhci: 'scratch' may be used uninitialized
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Noonan authored and Pierre Ossman committed Oct 12, 2008
1 parent 5710573 commit 7244b85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host)
{
unsigned long flags;
size_t blksize, len, chunk;
u32 scratch;
u32 uninitialized_var(scratch);
u8 *buf;

DBG("PIO reading\n");
Expand Down

0 comments on commit 7244b85

Please sign in to comment.