diff mbox series

mmc: pxamci: fix enum type confusion

Message ID 20190307100948.570006-1-arnd@arndb.de
State New
Headers show
Series mmc: pxamci: fix enum type confusion | expand

Commit Message

Arnd Bergmann March 7, 2019, 10:09 a.m. UTC
clang points out several instances of mismatched types in this drivers,
all coming from a single declaration:

drivers/mmc/host/pxamci.c:193:15: error: implicit conversion from enumeration type 'enum dma_transfer_direction' to
      different enumeration type 'enum dma_data_direction' [-Werror,-Wenum-conversion]
                direction = DMA_DEV_TO_MEM;
                          ~ ^~~~~~~~~~~~~~
drivers/mmc/host/pxamci.c:212:62: error: implicit conversion from enumeration type 'enum dma_data_direction' to
      different enumeration type 'enum dma_transfer_direction' [-Werror,-Wenum-conversion]
        tx = dmaengine_prep_slave_sg(chan, data->sg, host->dma_len, direction,

The behavior is correct, so this must be a simply typo from
dma_data_direction and dma_transfer_direction being similarly named
types with a similar purpose.

Fixes: 6464b7140951 ("mmc: pxamci: switch over to dmaengine use")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/mmc/host/pxamci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.0

Comments

Nathan Chancellor March 7, 2019, 3:20 p.m. UTC | #1
On Thu, Mar 07, 2019 at 11:09:19AM +0100, Arnd Bergmann wrote:
> clang points out several instances of mismatched types in this drivers,

> all coming from a single declaration:

> 

> drivers/mmc/host/pxamci.c:193:15: error: implicit conversion from enumeration type 'enum dma_transfer_direction' to

>       different enumeration type 'enum dma_data_direction' [-Werror,-Wenum-conversion]

>                 direction = DMA_DEV_TO_MEM;

>                           ~ ^~~~~~~~~~~~~~

> drivers/mmc/host/pxamci.c:212:62: error: implicit conversion from enumeration type 'enum dma_data_direction' to

>       different enumeration type 'enum dma_transfer_direction' [-Werror,-Wenum-conversion]

>         tx = dmaengine_prep_slave_sg(chan, data->sg, host->dma_len, direction,

> 

> The behavior is correct, so this must be a simply typo from

> dma_data_direction and dma_transfer_direction being similarly named

> types with a similar purpose.

> 

> Fixes: 6464b7140951 ("mmc: pxamci: switch over to dmaengine use")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>


> ---

>  drivers/mmc/host/pxamci.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c

> index c907bf502a12..c1d3f0e38921 100644

> --- a/drivers/mmc/host/pxamci.c

> +++ b/drivers/mmc/host/pxamci.c

> @@ -162,7 +162,7 @@ static void pxamci_dma_irq(void *param);

>  static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)

>  {

>  	struct dma_async_tx_descriptor *tx;

> -	enum dma_data_direction direction;

> +	enum dma_transfer_direction direction;

>  	struct dma_slave_config	config;

>  	struct dma_chan *chan;

>  	unsigned int nob = data->blocks;

> -- 

> 2.20.0

>
Robert Jarzmik March 7, 2019, 7:15 p.m. UTC | #2
Nathan Chancellor <natechancellor@gmail.com> writes:

> On Thu, Mar 07, 2019 at 11:09:19AM +0100, Arnd Bergmann wrote:

>> clang points out several instances of mismatched types in this drivers,

>> all coming from a single declaration:

>> 

>> drivers/mmc/host/pxamci.c:193:15: error: implicit conversion from enumeration type 'enum dma_transfer_direction' to

>>       different enumeration type 'enum dma_data_direction' [-Werror,-Wenum-conversion]

>>                 direction = DMA_DEV_TO_MEM;

>>                           ~ ^~~~~~~~~~~~~~

>> drivers/mmc/host/pxamci.c:212:62: error: implicit conversion from enumeration type 'enum dma_data_direction' to

>>       different enumeration type 'enum dma_transfer_direction' [-Werror,-Wenum-conversion]

>>         tx = dmaengine_prep_slave_sg(chan, data->sg, host->dma_len, direction,

>> 

>> The behavior is correct, so this must be a simply typo from

>> dma_data_direction and dma_transfer_direction being similarly named

>> types with a similar purpose.

>> 

>> Fixes: 6464b7140951 ("mmc: pxamci: switch over to dmaengine use")

>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

>

> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>


Cheers.

--
Robert
diff mbox series

Patch

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index c907bf502a12..c1d3f0e38921 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -162,7 +162,7 @@  static void pxamci_dma_irq(void *param);
 static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
 {
 	struct dma_async_tx_descriptor *tx;
-	enum dma_data_direction direction;
+	enum dma_transfer_direction direction;
 	struct dma_slave_config	config;
 	struct dma_chan *chan;
 	unsigned int nob = data->blocks;