From: Arnd Hannemann Date: Sun, 19 Dec 2010 21:16:07 +0000 (+0000) Subject: mmc: tmio_mmc: silence compiler warnings X-Git-Tag: upstream/snapshot3+hdmi~12083^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eba46030e1727f2af377300b6a55df846fa830f1;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mmc: tmio_mmc: silence compiler warnings 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 Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 595b7b3..f442c82 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -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) { @@ -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) {