* [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()
@ 2026-01-29 3:59 Andre Korol
2026-01-29 5:04 ` Binbin Zhou
2026-01-29 15:12 ` Ulf Hansson
0 siblings, 2 replies; 4+ messages in thread
From: Andre Korol @ 2026-01-29 3:59 UTC (permalink / raw)
To: ulf.hansson, zhoubinbin; +Cc: linux-mmc, linux-kernel, Andre Korol
dma_alloc_coherent() returns zeroed memory, so the memset() immediately
after allocation is redundant.
Signed-off-by: Andre Korol <andre.korol.dev@gmail.com>
---
drivers/mmc/host/loongson2-mmc.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
index da3daab5f3d6..026cbd80f114 100644
--- a/drivers/mmc/host/loongson2-mmc.c
+++ b/drivers/mmc/host/loongson2-mmc.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()
2026-01-29 3:59 [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent() Andre Korol
@ 2026-01-29 5:04 ` Binbin Zhou
2026-01-29 15:12 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Binbin Zhou @ 2026-01-29 5:04 UTC (permalink / raw)
To: Andre Korol, ulf.hansson; +Cc: linux-mmc, linux-kernel
On 2026/1/29 11:59, Andre Korol wrote:
> dma_alloc_coherent() returns zeroed memory, so the memset() immediately
> after allocation is redundant.
>
> Signed-off-by: Andre Korol <andre.korol.dev@gmail.com>
LGTM.
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
> drivers/mmc/host/loongson2-mmc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
> index da3daab5f3d6..026cbd80f114 100644
> --- a/drivers/mmc/host/loongson2-mmc.c
> +++ b/drivers/mmc/host/loongson2-mmc.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent()
2026-01-29 3:59 [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent() Andre Korol
2026-01-29 5:04 ` Binbin Zhou
@ 2026-01-29 15:12 ` Ulf Hansson
2026-01-29 18:10 ` Andre Korol
1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2026-01-29 15:12 UTC (permalink / raw)
To: Andre Korol; +Cc: zhoubinbin, linux-mmc, linux-kernel
On Thu, 29 Jan 2026 at 04:59, Andre Korol <andre.korol.dev@gmail.com> wrote:
>
> dma_alloc_coherent() returns zeroed memory, so the memset() immediately
> after allocation is redundant.
>
> Signed-off-by: Andre Korol <andre.korol.dev@gmail.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/loongson2-mmc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
> index da3daab5f3d6..026cbd80f114 100644
> --- a/drivers/mmc/host/loongson2-mmc.c
> +++ b/drivers/mmc/host/loongson2-mmc.c
> @@ -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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-29 18:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 3:59 [PATCH] mmc: loongson2-mmc: drop redundant memset after dma_alloc_coherent() Andre Korol
2026-01-29 5:04 ` Binbin Zhou
2026-01-29 15:12 ` Ulf Hansson
2026-01-29 18:10 ` Andre Korol
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox