All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch/powerpc: Improve _memcpy
@ 2009-11-03 14:20 Dirk Eibach
  0 siblings, 0 replies; only message in thread
From: Dirk Eibach @ 2009-11-03 14:20 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dirk Eibach

The implementation of _memcpy_fromio and _memcpy_toio seems to be suboptimal for size 4.

Signed-off-by: Dirk Eibach <eibach@gdsys.de>
---
 arch/powerpc/kernel/io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-03 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-03 14:20 [PATCH] arch/powerpc: Improve _memcpy Dirk Eibach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.