From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Cao Minh Hiep <cm-hiep@jinso.co.jp>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
Mark Brown <broonie@kernel.org>,
linux-spi <linux-spi@vger.kernel.org>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
Ryusuke Sakato <ryusuke.sakato.bx@renesas.com>,
Linux-sh list <linux-sh@vger.kernel.org>
Subject: Re: [PATCH 1/3] spi: Re-do the returning value of rspi_dma_check_then_transfer
Date: Tue, 28 Apr 2015 11:02:05 +0200 [thread overview]
Message-ID: <CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg@mail.gmail.com> (raw)
In-Reply-To: <1430200551-20708-2-git-send-email-cm-hiep@jinso.co.jp>
Hi Hiep-san,
On Tue, Apr 28, 2015 at 7:55 AM, Cao Minh Hiep <cm-hiep@jinso.co.jp> wrote:
> To reduce indentation and complex of code, insteeds of returning zero,
> the function rspi_dma_check_then_transfer should be returned
> rspi_dma_transfer directly after checking error.
Thanks for the update!
Unfortunately it doesn't compile...
> --- a/drivers/spi/spi-rspi.c
> +++ b/drivers/spi/spi-rspi.c
> @@ -665,15 +665,12 @@ static bool rspi_can_dma(struct spi_master *master, struct spi_device *spi,
> static int rspi_dma_check_then_transfer(struct rspi_data *rspi,
> struct spi_transfer *xfer)
> {
> - if (rspi->master->can_dma && __rspi_can_dma(rspi, xfer)) {
> - /* rx_buf can be NULL on RSPI on SH in TX-only Mode */
> - int ret = rspi_dma_transfer(rspi, &xfer->tx_sg,
> - xfer->rx_buf ? &xfer->rx_sg : NULL);
> - if (ret != -EAGAIN)
> - return 0;
> - }
> + if (!rspi->master->can_dma || !__rspi_can_dma(rspi, xfer)) {
Superfluous opening curly brace.
Please compile and run test your patches.
Thanks!
> + return -EAGAIN;
>
> - return -EAGAIN;
> + /* rx_buf can be NULL on RSPI on SH in TX-only Mode */
> + return rspi_dma_transfer(rspi, &xfer->tx_sg,
> + xfer->rx_buf ? &xfer->rx_sg : NULL);
> }
>
> static int rspi_common_transfer(struct rspi_data *rspi,
--
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2015-04-28 9:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 5:55 [PATCH 0/3 v2] spi: Re-do correctly function name and 'ret' return value Cao Minh Hiep
[not found] ` <1430200551-20708-1-git-send-email-cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2015-04-28 5:55 ` [PATCH 1/3] spi: Re-do the returning value of rspi_dma_check_then_transfer Cao Minh Hiep
2015-04-28 9:02 ` Geert Uytterhoeven [this message]
[not found] ` <CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 0:26 ` Cao Minh Hiep
[not found] ` <1430200551-20708-2-git-send-email-cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2015-04-28 11:45 ` Sergei Shtylyov
[not found] ` <553F72F1.9010300-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2015-04-30 0:33 ` Cao Minh Hiep
2015-04-28 5:55 ` [PATCH 2/3] spi: modify the name of qspi_trigger_transfer_out_int function Cao Minh Hiep
[not found] ` <1430200551-20708-3-git-send-email-cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
2015-04-28 11:07 ` Geert Uytterhoeven
2015-04-30 0:27 ` Cao Minh Hiep
2015-04-28 5:55 ` [PATCH 3/3] spi: Re-do the returning value of qspi_transfer_out_in Cao Minh Hiep
2015-04-28 11:07 ` Geert Uytterhoeven
2015-04-30 0:28 ` Cao Minh Hiep
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=CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=broonie@kernel.org \
--cc=cm-hiep@jinso.co.jp \
--cc=geert+renesas@glider.be \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-sh@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=ryusuke.sakato.bx@renesas.com \
--cc=yoshihiro.shimoda.uh@renesas.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).