Skip to contentSkip to conversation

soc: ti: knav_dma: Use proper enum in pktdma_init_chan

PATCH In review Nathan Chancellor 2 participants 3 messages Dec 11, 2018 – Jan 29, 2019 TI Keystone multicore navigator drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: ti: knav_dma: Use proper enum in pktdma_init_chan

Clang warns when one enumerated type is implicitly converted to another:

drivers/soc/ti/knav_dma.c:601:20: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]

        chan->direction = DMA_NONE;
                        ~ ^~~~~~~~

1 warning generated.

While DMA_NONE and DMA_TRANS_NONE have different values, there is no functional change because direction is never checked against DMA_NONE, only against DMA_MEM_TO_DEV and DMA_DEV_TO_MEM.

---
 drivers/soc/ti/knav_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ti/knav_dma.c +1 -1
index e05ab16d9a9e..6285cd8efb21 100644
@@ -598,7 +598,7 @@ static int pktdma_init_chan(struct knav_dma_device *dma,
 
 	INIT_LIST_HEAD(&chan->list);
 	chan->dma	= dma;
-	chan->direction	= DMA_NONE;
+	chan->direction	= DMA_TRANS_NONE;
 	atomic_set(&chan->ref_count, 0);
 	spin_lock_init(&chan->lock);
 
Signature · 1 line
2.20.0
#1 lore raw
Quoted 34 lines · Nathan Chancellor

Clang warns when one enumerated type is implicitly converted to another:

drivers/soc/ti/knav_dma.c:601:20: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]

        chan->direction = DMA_NONE;
                        ~ ^~~~~~~~

1 warning generated.

While DMA_NONE and DMA_TRANS_NONE have different values, there is no functional change because direction is never checked against DMA_NONE, only against DMA_MEM_TO_DEV and DMA_DEV_TO_MEM.

---
 drivers/soc/ti/knav_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ti/knav_dma.c +1 -1
index e05ab16d9a9e..6285cd8efb21 100644
@@ -598,7 +598,7 @@ static int pktdma_init_chan(struct knav_dma_device *dma,
 
 	INIT_LIST_HEAD(&chan->list);
 	chan->dma	= dma;
-	chan->direction	= DMA_NONE;
+	chan->direction	= DMA_TRANS_NONE;
 	atomic_set(&chan->ref_count, 0);
 	spin_lock_init(&chan->lock);
 
Signature · 1 line
2.20.0

Ping?

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw
Quoted 38 lines · Nathan Chancellor
Quoted 34 lines · Nathan Chancellor

Clang warns when one enumerated type is implicitly converted to another:

drivers/soc/ti/knav_dma.c:601:20: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]

         chan->direction = DMA_NONE;
                         ~ ^~~~~~~~

1 warning generated.

While DMA_NONE and DMA_TRANS_NONE have different values, there is no functional change because direction is never checked against DMA_NONE, only against DMA_MEM_TO_DEV and DMA_DEV_TO_MEM.

---
  drivers/soc/ti/knav_dma.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ti/knav_dma.c +1 -1
index e05ab16d9a9e..6285cd8efb21 100644
@@ -598,7 +598,7 @@ static int pktdma_init_chan(struct knav_dma_device *dma,
 
  	INIT_LIST_HEAD(&chan->list);
  	chan->dma	= dma;
-	chan->direction	= DMA_NONE;
+	chan->direction	= DMA_TRANS_NONE;
  	atomic_set(&chan->ref_count, 0);
  	spin_lock_init(&chan->lock);
 
Signature · 1 line
2.20.0

Ping?
I have marked this to picked up. Thanks !!