From be3d1f1b9d4b4658b4aaf65096f1412315626c4e Mon Sep 17 00:00:00 2001 From: Dai Xin Date: Wed, 24 Aug 2022 16:38:29 +0000 Subject: [PATCH] sw64: lib: fix __iowrite64_copy() Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG -------------------------------- The mb() is supposed to be in the loop as what __iowrite32_copy() does. Besides, CONFIG_64BIT is always true for SW64, so remove the redundant #if statement. Signed-off-by: Dai Xin Signed-off-by: Gu Zitao --- arch/sw_64/lib/iomap_copy.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/sw_64/lib/iomap_copy.c b/arch/sw_64/lib/iomap_copy.c index 10e756fffff5..1c75bd602d7e 100644 --- a/arch/sw_64/lib/iomap_copy.c +++ b/arch/sw_64/lib/iomap_copy.c @@ -41,15 +41,12 @@ void __iowrite64_copy(void __iomem *to, const void *from, size_t count) { -#ifdef CONFIG_64BIT u64 __iomem *dst = to; const u64 *src = from; const u64 *end = src + count; - while (src < end) + while (src < end) { __raw_writeq(*src++, dst++); mb(); -#else - __iowrite32_copy(to, from, count * 2); -#endif + } } -- GitLab