Skip to content

Commit

Permalink
mmc: tmio_mmc: silence compiler warnings
Browse files Browse the repository at this point in the history
with "mmc: tmio: implement a bounce buffer for unaligned DMA"
gcc generates the following warnings:

drivers/mmc/host/tmio_mmc.c:654:6: warning: 'ret' may be used uninitialized in this function
drivers/mmc/host/tmio_mmc.c:730:6: warning: 'ret' may be used uninitialized in this function

This patch fixes these by setting ret to -EINVAL in the affected code paths.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Arnd Hannemann authored and Chris Ball committed Jan 9, 2011
1 parent 9317305 commit eba4603
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/mmc/host/tmio_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,10 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
}

if ((!aligned && (host->sg_len > 1 || sg->length > PAGE_CACHE_SIZE ||
align >= MAX_ALIGN)) || !multiple)
align >= MAX_ALIGN)) || !multiple) {
ret = -EINVAL;
goto pio;
}

/* The only sg element can be unaligned, use our bounce buffer then */
if (!aligned) {
Expand Down Expand Up @@ -748,8 +750,10 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
}

if ((!aligned && (host->sg_len > 1 || sg->length > PAGE_CACHE_SIZE ||
align >= MAX_ALIGN)) || !multiple)
align >= MAX_ALIGN)) || !multiple) {
ret = -EINVAL;
goto pio;
}

/* The only sg element can be unaligned, use our bounce buffer then */
if (!aligned) {
Expand Down

0 comments on commit eba4603

Please sign in to comment.