linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Hannemann <arnd@arndnet.de>
To: g.liakhovetski@gmx.de, linux-mmc@vger.kernel.org
Cc: linux-sh@vger.kernel.org, Ian Molton <ian@mnementh.co.uk>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Arnd Hannemann <arnd@arndnet.de>
Subject: [PATCH] mmc: tmio_mmc: silence compiler warnings
Date: Sun, 19 Dec 2010 21:16:07 +0000	[thread overview]
Message-ID: <1292793367-5638-1-git-send-email-arnd@arndnet.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1011231723090.25676@axis700.grange>

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@arndnet.de>
---
 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


  parent reply	other threads:[~2010-12-19 21:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 16:24 [PATCH 0/3] handle unaligned buffers, when using TMIO-MMC with DMA Guennadi Liakhovetski
2010-11-23 16:24 ` [PATCH 1/3] mmc: tmio: merge the private header into the driver Guennadi Liakhovetski
2011-01-05 19:50   ` Chris Ball
2010-11-23 16:24 ` [PATCH 2/3] mmc: tmio: implement a bounce buffer for unaligned DMA Guennadi Liakhovetski
2010-11-26 12:04   ` [PATCH 2/3] mmc: tmio: implement a bounce buffer for unaligned Samuel Ortiz
2010-12-19 21:16   ` Arnd Hannemann [this message]
2011-01-05 20:48     ` [PATCH] mmc: tmio_mmc: silence compiler warnings Chris Ball
2010-12-22 11:02   ` [PATCH 2/3 v2] mmc: tmio: implement a bounce buffer for unaligned Guennadi Liakhovetski
2010-12-24 11:11     ` [PATCH 2/3 v2] mmc: tmio: implement a bounce buffer for Samuel Ortiz
2011-01-05 19:56   ` [PATCH 2/3] mmc: tmio: implement a bounce buffer for unaligned Chris Ball
2011-01-05 20:56     ` [PATCH 2/3 v3] " Guennadi Liakhovetski
2011-01-05 21:06       ` [PATCH 2/3 v3] mmc: tmio: implement a bounce buffer for Chris Ball
2010-11-23 16:24 ` [PATCH 3/3] mfd: sdhi: require the tmio-mmc driver to bounce unaligned Guennadi Liakhovetski
2010-11-26 12:05   ` [PATCH 3/3] mfd: sdhi: require the tmio-mmc driver to bounce Samuel Ortiz
2011-01-05 20:49   ` Chris Ball
2010-12-14 16:07 ` [PATCH 0/3] handle unaligned buffers, when using TMIO-MMC with Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292793367-5638-1-git-send-email-arnd@arndnet.de \
    --to=arnd@arndnet.de \
    --cc=g.liakhovetski@gmx.de \
    --cc=ian@mnementh.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).