Commit eba46030 authored by Arnd Hannemann's avatar Arnd Hannemann Committed by Chris Ball

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: default avatarArnd Hannemann <arnd@arndnet.de>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 93173054
...@@ -673,8 +673,10 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host) ...@@ -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 || if ((!aligned && (host->sg_len > 1 || sg->length > PAGE_CACHE_SIZE ||
align >= MAX_ALIGN)) || !multiple) align >= MAX_ALIGN)) || !multiple) {
ret = -EINVAL;
goto pio; goto pio;
}
/* The only sg element can be unaligned, use our bounce buffer then */ /* The only sg element can be unaligned, use our bounce buffer then */
if (!aligned) { if (!aligned) {
...@@ -748,8 +750,10 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) ...@@ -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 || if ((!aligned && (host->sg_len > 1 || sg->length > PAGE_CACHE_SIZE ||
align >= MAX_ALIGN)) || !multiple) align >= MAX_ALIGN)) || !multiple) {
ret = -EINVAL;
goto pio; goto pio;
}
/* The only sg element can be unaligned, use our bounce buffer then */ /* The only sg element can be unaligned, use our bounce buffer then */
if (!aligned) { if (!aligned) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment