Skip to contentSkip to conversation

dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit

PATCH In review Ruiqi Li 2 participants 2 messages May 10, 2022 – May 12, 2022

Subsystems (2)
lore
Share & tools
lore

Ruiqi Li

author
#0 lore raw

PATCH 1/1 dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit

Commit at 8fc5133d fixed unaligned memory access, which caused both 32 and 64 bit to be the same.

    #ifdef CONFIG_64BIT
    /* llp is not aligned on 64bit -> keep 32bit accesses */
    SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
              lower_32_bits(chunk->ll_region.paddr));
    SET_CH_32(dw, chan->dir, chan->id, llp.msb,
              upper_32_bits(chunk->ll_region.paddr));
    #else /* CONFIG_64BIT */
    SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
              lower_32_bits(chunk->ll_region.paddr));
    SET_CH_32(dw, chan->dir, chan->id, llp.msb,
              upper_32_bits(chunk->ll_region.paddr));
    #endif /* CONFIG_64BIT */

This patch removes redundant preprocessor check for 64 bit.

---
 drivers/dma/dw-edma/dw-edma-v0-core.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/dma/dw-edma/dw-edma-v0-core.c +0 -7
index 33bc1e6c4cf2..d34f344a094b 100644
@@ -415,18 +415,11 @@ void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
 			  (DW_EDMA_V0_CCS | DW_EDMA_V0_LLE));
 		/* Linked list */
 
-		#ifdef CONFIG_64BIT
 		/* llp is not aligned on 64bit -> keep 32bit accesses */
 		SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
 			  lower_32_bits(chunk->ll_region.paddr));
 		SET_CH_32(dw, chan->dir, chan->id, llp.msb,
 			  upper_32_bits(chunk->ll_region.paddr));
-		#else /* CONFIG_64BIT */
-		SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
-			  lower_32_bits(chunk->ll_region.paddr));
-		SET_CH_32(dw, chan->dir, chan->id, llp.msb,
-			  upper_32_bits(chunk->ll_region.paddr));
-		#endif /* CONFIG_64BIT */
 	}
 	/* Doorbell */
 	SET_RW_32(dw, chan->dir, doorbell,
Signature · 1 line
2.36.1
#1 lore raw

Hello Ruiqu

Quoted 16 lines · Ruiqi Li

Commit at 8fc5133d fixed unaligned memory access, which caused both 32 and 64 bit to be the same.

    #ifdef CONFIG_64BIT
    /* llp is not aligned on 64bit -> keep 32bit accesses */
    SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
              lower_32_bits(chunk->ll_region.paddr));
    SET_CH_32(dw, chan->dir, chan->id, llp.msb,
              upper_32_bits(chunk->ll_region.paddr));
    #else /* CONFIG_64BIT */
    SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
              lower_32_bits(chunk->ll_region.paddr));
    SET_CH_32(dw, chan->dir, chan->id, llp.msb,
              upper_32_bits(chunk->ll_region.paddr));
    #endif /* CONFIG_64BIT */
Quoted 1 line

This patch removes redundant preprocessor check for 64 bit.

A similar fix but with another reasoning has already been submitted:

So not only the denoted but all 64BIT-ifdef's will be dropped from the driver.

-Sergey

Quoted 32 lines
---
 drivers/dma/dw-edma/dw-edma-v0-core.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/dma/dw-edma/dw-edma-v0-core.c +0 -7
index 33bc1e6c4cf2..d34f344a094b 100644
@@ -415,18 +415,11 @@ void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
 			  (DW_EDMA_V0_CCS | DW_EDMA_V0_LLE));
 		/* Linked list */
 
-		#ifdef CONFIG_64BIT
 		/* llp is not aligned on 64bit -> keep 32bit accesses */
 		SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
 			  lower_32_bits(chunk->ll_region.paddr));
 		SET_CH_32(dw, chan->dir, chan->id, llp.msb,
 			  upper_32_bits(chunk->ll_region.paddr));
-		#else /* CONFIG_64BIT */
-		SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
-			  lower_32_bits(chunk->ll_region.paddr));
-		SET_CH_32(dw, chan->dir, chan->id, llp.msb,
-			  upper_32_bits(chunk->ll_region.paddr));
-		#endif /* CONFIG_64BIT */
 	}
 	/* Doorbell */
 	SET_RW_32(dw, chan->dir, doorbell,
Signature · 1 line
2.36.1