aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-01-13 16:25:41 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2016-01-14 05:00:29 -0500
commitd50f42384dbfcf5143de614710e132dc06cd2439 (patch)
treea47cb5297cd8b7481b5d5496e8915fac2bac6f00 /drivers/mmc
parente10c321977091f163eceedec0650e0ef4b3cf4bb (diff)
mmc: tmio_mmc_dma: don't print invalid DMA cookie
The tmio_mmc_start_dma_{rx,tx} function functions contain debug code that prints the dma cookie among other things. However, in case we fall back to PIO mode for some reason, the cookie variable is never initialized, and gcc warns about this: In file included from ../include/linux/printk.h:277:0, from ../include/linux/kernel.h:13, from ../include/linux/list.h:8, from ../include/linux/kobject.h:20, from ../include/linux/device.h:17, from ../drivers/mmc/host/tmio_mmc_dma.c:13: ../drivers/mmc/host/tmio_mmc_dma.c: In function 'tmio_mmc_start_dma': ../include/linux/dynamic_debug.h:86:3: warning: 'cookie' may be used uninitialized in this function [-Wmaybe-uninitialized] __dynamic_dev_dbg(&descriptor, dev, fmt, \ ^ ../drivers/mmc/host/tmio_mmc_dma.c:128:15: note: 'cookie' was declared here dma_cookie_t cookie; This modifies the dev_dbg() statements so we only print the cookie when we are already in the DMA path. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/tmio_mmc_dma.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index e4b05dbb9ca8..4a0d6b80eaa3 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -94,9 +94,9 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
94 desc = NULL; 94 desc = NULL;
95 ret = cookie; 95 ret = cookie;
96 } 96 }
97 dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n",
98 __func__, host->sg_len, ret, cookie, host->mrq);
97 } 99 }
98 dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n",
99 __func__, host->sg_len, ret, cookie, host->mrq);
100 100
101pio: 101pio:
102 if (!desc) { 102 if (!desc) {
@@ -116,8 +116,8 @@ pio:
116 "DMA failed: %d, falling back to PIO\n", ret); 116 "DMA failed: %d, falling back to PIO\n", ret);
117 } 117 }
118 118
119 dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d, sg[%d]\n", __func__, 119 dev_dbg(&host->pdev->dev, "%s(): desc %p, sg[%d]\n", __func__,
120 desc, cookie, host->sg_len); 120 desc, host->sg_len);
121} 121}
122 122
123static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) 123static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
@@ -174,9 +174,9 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host)
174 desc = NULL; 174 desc = NULL;
175 ret = cookie; 175 ret = cookie;
176 } 176 }
177 dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n",
178 __func__, host->sg_len, ret, cookie, host->mrq);
177 } 179 }
178 dev_dbg(&host->pdev->dev, "%s(): mapped %d -> %d, cookie %d, rq %p\n",
179 __func__, host->sg_len, ret, cookie, host->mrq);
180 180
181pio: 181pio:
182 if (!desc) { 182 if (!desc) {
@@ -196,8 +196,7 @@ pio:
196 "DMA failed: %d, falling back to PIO\n", ret); 196 "DMA failed: %d, falling back to PIO\n", ret);
197 } 197 }
198 198
199 dev_dbg(&host->pdev->dev, "%s(): desc %p, cookie %d\n", __func__, 199 dev_dbg(&host->pdev->dev, "%s(): desc %p\n", __func__, desc);
200 desc, cookie);
201} 200}
202 201
203void tmio_mmc_start_dma(struct tmio_mmc_host *host, 202void tmio_mmc_start_dma(struct tmio_mmc_host *host,