From: Albrecht Dreß Date: Wed, 4 Nov 2009 23:43:12 +0000 (-0700) Subject: powerpc: tiny memcpy_(to|from)io optimisation X-Git-Tag: v2.6.33-rc1~9^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a22c65f81ae28656b80d2acc687cf6318eb15bba;p=profile%2Fivi%2Fkernel-x86-ivi.git powerpc: tiny memcpy_(to|from)io optimisation This trivial patch changes memcpy_(to|from)io as to transfer as many 32-bit words as possible in 32-bit accesses (in the current solution, the last 32-bit word was transferred as 4 byte accesses). Signed-off-by: Albrecht Dreß Signed-off-by: Grant Likely --- diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c index 1882bf4..8dc7547 100644 --- a/arch/powerpc/kernel/io.c +++ b/arch/powerpc/kernel/io.c @@ -161,7 +161,7 @@ void _memcpy_fromio(void *dest, const volatile void __iomem *src, dest++; n--; } - while(n > 4) { + while(n >= 4) { *((u32 *)dest) = *((volatile u32 *)vsrc); eieio(); vsrc += 4; @@ -190,7 +190,7 @@ void _memcpy_toio(volatile void __iomem *dest, const void *src, unsigned long n) vdest++; n--; } - while(n > 4) { + while(n >= 4) { *((volatile u32 *)vdest) = *((volatile u32 *)src); src += 4; vdest += 4;