Skip to contentSkip to conversation

mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()

PATCH In review Andre Korol 3 participants 4 messages Jan 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()

dma_alloc_coherent() returns zeroed memory, so the memset() immediately after allocation is redundant.

---
 drivers/mmc/host/loongson2-mmc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mmc/host/loongson2-mmc.c +0 -1
index da3daab5f3d6..026cbd80f114 100644
@@ -846,7 +846,6 @@ static int ls2k2000_mmc_set_internal_dma(struct loongson2_mmc_host *host,
 	if (!host->sg_cpu)
 		return -ENOMEM;
 
-	memset(host->sg_cpu, 0, PAGE_SIZE);
 	return 0;
 }
 
Signature · 1 line
2.51.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andre Korol

dma_alloc_coherent() returns zeroed memory, so the memset() immediately after allocation is redundant.

LGTM.

Quoted 16 lines
---
  drivers/mmc/host/loongson2-mmc.c | 1 -
  1 file changed, 1 deletion(-)
drivers/mmc/host/loongson2-mmc.c +0 -1
index da3daab5f3d6..026cbd80f114 100644
@@ -846,7 +846,6 @@ static int ls2k2000_mmc_set_internal_dma(struct loongson2_mmc_host *host,
  	if (!host->sg_cpu)
  		return -ENOMEM;
 
-	memset(host->sg_cpu, 0, PAGE_SIZE);
  	return 0;
  }
 
#2 lore raw
In reply to Andre Korol
Quoted 5 lines · Andre Korol

dma_alloc_coherent() returns zeroed memory, so the memset() immediately after allocation is redundant.

Applied for next, thanks!

Kind regards
Uffe

Quoted 19 lines
---
 drivers/mmc/host/loongson2-mmc.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mmc/host/loongson2-mmc.c +0 -2
index da3daab5f3d6..026cbd80f114 100644
@@ -846,7 +846,6 @@ static int ls2k2000_mmc_set_internal_dma(struct loongson2_mmc_host *host,
        if (!host->sg_cpu)
                return -ENOMEM;
 
-       memset(host->sg_cpu, 0, PAGE_SIZE);
        return 0;
 }
 
--

2.51.0