All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] spi: rspi: use correct enum for DMA transfer direction
@ 2018-03-19 22:16 Stefan Agner
  2018-03-20  1:06 ` Applied "spi: rspi: use correct enum for DMA transfer direction" to the spi tree Mark Brown
  2018-03-21  8:06 ` [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Agner @ 2018-03-19 22:16 UTC (permalink / raw)
  To: broonie; +Cc: geert+renesas, linux-spi, linux-kernel, Stefan Agner

Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg
instead of enum dma_data_direction. This won't change behavior in
practice as the enum values are equivalent.

This fixes two warnings when building with clang:
  drivers/spi/spi-rspi.c:538:26: warning: implicit conversion from enumeration
      type 'enum dma_data_direction' to different enumeration type
      'enum dma_transfer_direction' [-Wenum-conversion]
                                        rx->sgl, rx->nents, DMA_FROM_DEVICE,
                                                            ^~~~~~~~~~~~~~~
  drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration
      type 'enum dma_data_direction' to different enumeration type
      'enum dma_transfer_direction' [-Wenum-conversion]
                                        tx->sgl, tx->nents, DMA_TO_DEVICE,
                                                            ^~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/spi/spi-rspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 0835a8d88fb8..95dc4d78618d 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -535,7 +535,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
 	/* First prepare and submit the DMA request(s), as this may fail */
 	if (rx) {
 		desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx,
-					rx->sgl, rx->nents, DMA_FROM_DEVICE,
+					rx->sgl, rx->nents, DMA_DEV_TO_MEM,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 		if (!desc_rx) {
 			ret = -EAGAIN;
@@ -555,7 +555,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
 
 	if (tx) {
 		desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx,
-					tx->sgl, tx->nents, DMA_TO_DEVICE,
+					tx->sgl, tx->nents, DMA_MEM_TO_DEV,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 		if (!desc_tx) {
 			ret = -EAGAIN;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Applied "spi: rspi: use correct enum for DMA transfer direction" to the spi tree
  2018-03-19 22:16 [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Stefan Agner
@ 2018-03-20  1:06 ` Mark Brown
  2018-03-21  8:06 ` [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-03-20  1:06 UTC (permalink / raw)
  To: Stefan Agner
  Cc: Mark Brown, broonie, geert+renesas, linux-spi, linux-kernel, linux-spi

The patch

   spi: rspi: use correct enum for DMA transfer direction

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 768d59f5d0139a6ff09e4430ec29cdc8b436421a Mon Sep 17 00:00:00 2001
From: Stefan Agner <stefan@agner.ch>
Date: Mon, 19 Mar 2018 23:16:22 +0100
Subject: [PATCH] spi: rspi: use correct enum for DMA transfer direction

Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg
instead of enum dma_data_direction. This won't change behavior in
practice as the enum values are equivalent.

This fixes two warnings when building with clang:
  drivers/spi/spi-rspi.c:538:26: warning: implicit conversion from enumeration
      type 'enum dma_data_direction' to different enumeration type
      'enum dma_transfer_direction' [-Wenum-conversion]
                                        rx->sgl, rx->nents, DMA_FROM_DEVICE,
                                                            ^~~~~~~~~~~~~~~
  drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration
      type 'enum dma_data_direction' to different enumeration type
      'enum dma_transfer_direction' [-Wenum-conversion]
                                        tx->sgl, tx->nents, DMA_TO_DEVICE,
                                                            ^~~~~~~~~~~~~

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-rspi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 0835a8d88fb8..95dc4d78618d 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -535,7 +535,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
 	/* First prepare and submit the DMA request(s), as this may fail */
 	if (rx) {
 		desc_rx = dmaengine_prep_slave_sg(rspi->master->dma_rx,
-					rx->sgl, rx->nents, DMA_FROM_DEVICE,
+					rx->sgl, rx->nents, DMA_DEV_TO_MEM,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 		if (!desc_rx) {
 			ret = -EAGAIN;
@@ -555,7 +555,7 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
 
 	if (tx) {
 		desc_tx = dmaengine_prep_slave_sg(rspi->master->dma_tx,
-					tx->sgl, tx->nents, DMA_TO_DEVICE,
+					tx->sgl, tx->nents, DMA_MEM_TO_DEV,
 					DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
 		if (!desc_tx) {
 			ret = -EAGAIN;
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] spi: rspi: use correct enum for DMA transfer direction
  2018-03-19 22:16 [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Stefan Agner
  2018-03-20  1:06 ` Applied "spi: rspi: use correct enum for DMA transfer direction" to the spi tree Mark Brown
@ 2018-03-21  8:06 ` Geert Uytterhoeven
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2018-03-21  8:06 UTC (permalink / raw)
  To: Stefan Agner
  Cc: Mark Brown, Geert Uytterhoeven, linux-spi, Linux Kernel Mailing List

Hi Stefan,

On Mon, Mar 19, 2018 at 11:16 PM, Stefan Agner <stefan@agner.ch> wrote:
> Use enum dma_transfer_direction as required by dmaengine_prep_slave_sg
> instead of enum dma_data_direction. This won't change behavior in
> practice as the enum values are equivalent.

Thanks for catching!

BTW, spi-sh-msiof has the same issue. Will sent a fix.

> This fixes two warnings when building with clang:
>   drivers/spi/spi-rspi.c:538:26: warning: implicit conversion from enumeration
>       type 'enum dma_data_direction' to different enumeration type
>       'enum dma_transfer_direction' [-Wenum-conversion]
>                                         rx->sgl, rx->nents, DMA_FROM_DEVICE,
>                                                             ^~~~~~~~~~~~~~~
>   drivers/spi/spi-rspi.c:558:26: warning: implicit conversion from enumeration
>       type 'enum dma_data_direction' to different enumeration type
>       'enum dma_transfer_direction' [-Wenum-conversion]
>                                         tx->sgl, tx->nents, DMA_TO_DEVICE,
>                                                             ^~~~~~~~~~~~~
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

JFTR, as it's already applied
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-21  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 22:16 [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Stefan Agner
2018-03-20  1:06 ` Applied "spi: rspi: use correct enum for DMA transfer direction" to the spi tree Mark Brown
2018-03-21  8:06 ` [PATCH v2] spi: rspi: use correct enum for DMA transfer direction Geert Uytterhoeven

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.