[PATCH] mmc: tmio_mmc: silence compiler warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

This patch applies on top of -rc6 plus the following patches:
  mmc: tmio_mmc: allow multi-element scatter-gather lists
  mmc: tmio_mmc: fix PIO fallback on DMA descriptor allocation failure
  mmc: tmio: merge the private header into the driver
  mmc: tmio: implement a bounce buffer for unaligned DMA

Signed-off-by: Arnd Hannemann <arnd@xxxxxxxxxx>
---
 drivers/mmc/host/tmio_mmc.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 57ece9d..61e97d1 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -665,8 +665,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) {
@@ -741,8 +743,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) {
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux