From: Cao Minh Hiep <cm-hiep@jinso.co.jp>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: Geert Uytterhoeven
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Kuninori Morimoto
<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Yoshihiro Shimoda
<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Ryusuke Sakato
<ryusuke.sakato.bx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Linux-sh list <linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/3] spi: Re-do the returning value of rspi_dma_check_then_transfer
Date: Thu, 30 Apr 2015 00:26:46 +0000 [thread overview]
Message-ID: <554176C6.8040402@jinso.co.jp> (raw)
In-Reply-To: <CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Geert-san,
On 2015年04月28日 18:02, Geert Uytterhoeven wrote:
> 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...
Sorry to bother you again.
>> --- 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!
Thanks, I'll fix it and send you at a moment.
>> + 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,
>
>
>
Hiep.
WARNING: multiple messages have this Message-ID (diff)
From: Cao Minh Hiep <cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org>
To: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Cc: Geert Uytterhoeven
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Kuninori Morimoto
<kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Yoshihiro Shimoda
<yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Ryusuke Sakato
<ryusuke.sakato.bx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>,
Linux-sh list <linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/3] spi: Re-do the returning value of rspi_dma_check_then_transfer
Date: Thu, 30 Apr 2015 09:26:46 +0900 [thread overview]
Message-ID: <554176C6.8040402@jinso.co.jp> (raw)
In-Reply-To: <CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Geert-san,
On 2015年04月28日 18:02, Geert Uytterhoeven wrote:
> Hi Hiep-san,
>
> On Tue, Apr 28, 2015 at 7:55 AM, Cao Minh Hiep <cm-hiep-HEF513clHfp3+QwDJ9on6Q@public.gmane.org> 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...
Sorry to bother you again.
>> --- 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!
Thanks, I'll fix it and send you at a moment.
>> + 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,
>
>
>
Hiep.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-04-30 0:26 UTC|newest]
Thread overview: 24+ 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
2015-04-28 5:55 ` 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 5:55 ` Cao Minh Hiep
2015-04-28 9:02 ` Geert Uytterhoeven
2015-04-28 9:02 ` Geert Uytterhoeven
[not found] ` <CAMuHMdU8fHW9SCHPTpjwQMfsQc7Qn3F29-P2tsi_j-4Pjp_QCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 0:26 ` Cao Minh Hiep [this message]
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
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-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
2015-04-28 5:55 ` 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-28 11:07 ` Geert Uytterhoeven
2015-04-30 0:27 ` Cao Minh Hiep
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 5:55 ` Cao Minh Hiep
2015-04-28 11:07 ` Geert Uytterhoeven
2015-04-28 11:07 ` Geert Uytterhoeven
2015-04-30 0:28 ` Cao Minh Hiep
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=554176C6.8040402@jinso.co.jp \
--to=cm-hiep@jinso.co.jp \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
--cc=geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org \
--cc=kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ryusuke.sakato.bx-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org \
--cc=yoshihiro.shimoda.uh-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.