From: Nicholas Mc Guire <hofrat@osadl.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Nicholas Mc Guire <der.herr@hofr.at>
Subject: [PATCH 3/5] spi: sh-msiof: cleanup wait_for_completion return handling
Date: Mon, 2 Feb 2015 03:30:34 -0500 [thread overview]
Message-ID: <1422865837-10357-3-git-send-email-hofrat@osadl.org> (raw)
In-Reply-To: <1422865837-10357-1-git-send-email-hofrat@osadl.org>
From: Nicholas Mc Guire <der.herr@hofr.at>
return type of wait_for_completion_timeout is unsigned long not int, this
patch uses the return value of wait_for_completion_timeout in the condition
directly rather than assigning it to an incorrect type variable.
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---
The return type of wait_for_completion_timeout is unsigned long not
int. This patch resolves the type missmatch by moving the call to
wait_for_completion_timeout into the condition.
This patch was only compile tested with: polaris_defconfig
CONFIG_SPI=y, CONFIG_SPI_SH_MSIOF=m
Patch is against 3.19.0-rc6 -next-20150130
drivers/spi/spi-sh-msiof.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 9a884e6..9409873 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -640,8 +640,7 @@ static int sh_msiof_spi_txrx_once(struct sh_msiof_spi_priv *p,
}
/* wait for tx fifo to be emptied / rx fifo to be filled */
- ret = wait_for_completion_timeout(&p->done, HZ);
- if (!ret) {
+ if (!wait_for_completion_timeout(&p->done, HZ)) {
dev_err(&p->pdev->dev, "PIO timeout\n");
ret = -ETIMEDOUT;
goto stop_reset;
@@ -751,8 +750,7 @@ static int sh_msiof_dma_once(struct sh_msiof_spi_priv *p, const void *tx,
}
/* wait for tx fifo to be emptied / rx fifo to be filled */
- ret = wait_for_completion_timeout(&p->done, HZ);
- if (!ret) {
+ if (!wait_for_completion_timeout(&p->done, HZ)) {
dev_err(&p->pdev->dev, "DMA timeout\n");
ret = -ETIMEDOUT;
goto stop_reset;
--
1.7.10.4
next prev parent reply other threads:[~2015-02-02 8:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 8:30 [PATCH 1/5] spi: match var type to return type of wait_for_completion Nicholas Mc Guire
2015-02-02 8:30 ` [PATCH 2/5] spi: mxs: cleanup wait_for_completion return handling Nicholas Mc Guire
2015-02-02 12:11 ` Mark Brown
2015-02-02 8:30 ` Nicholas Mc Guire [this message]
2015-02-04 20:53 ` [PATCH 3/5] spi: sh-msiof: " Mark Brown
2015-02-02 8:30 ` [PATCH 4/5] spi: spi-imx: cleanup wait_for_completion handling Nicholas Mc Guire
2015-02-04 20:53 ` Mark Brown
2015-02-02 8:30 ` [PATCH 5/5] spi: ti-qspi: cleanup wait_for_completion return handling Nicholas Mc Guire
2015-02-02 12:16 ` Mark Brown
2015-02-04 20:52 ` [PATCH 1/5] spi: match var type to return type of wait_for_completion Mark Brown
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=1422865837-10357-3-git-send-email-hofrat@osadl.org \
--to=hofrat@osadl.org \
--cc=broonie@kernel.org \
--cc=der.herr@hofr.at \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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).