[PATCH] include/asm-x86/string_32.h - style only

Previous thread: [PATCH] ibmpex: Update Kconfig to list more supported models by Darrick J. Wong on Wednesday, March 12, 2008 - 6:18 pm. (1 message)

Next thread: linux list by gshan on Wednesday, March 12, 2008 - 6:56 pm. (1 message)
From: Joe Perches
Date: Wednesday, March 12, 2008 - 6:34 pm

Looked at this file because of __memcpy warnings.
Thought it could use a style/checkpatch cleanup.

No change in vmlinux

Signed-off-by: Joe Perches <joe@perches.com>

 include/asm-x86/string_32.h |  298 +++++++++++++++++++++++++------------------
 1 files changed, 171 insertions(+), 127 deletions(-)

diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h
index c5d13a8..3cb2b35 100644
--- a/include/asm-x86/string_32.h
+++ b/include/asm-x86/string_32.h
@@ -29,81 +29,114 @@ extern char *strchr(const char *s, int c);
 #define __HAVE_ARCH_STRLEN
 extern size_t strlen(const char *s);
 
-static __always_inline void * __memcpy(void * to, const void * from, size_t n)
+static __always_inline void *__memcpy(void *to, const void *from, size_t n)
 {
-int d0, d1, d2;
-__asm__ __volatile__(
-	"rep ; movsl\n\t"
-	"movl %4,%%ecx\n\t"
-	"andl $3,%%ecx\n\t"
-	"jz 1f\n\t"
-	"rep ; movsb\n\t"
-	"1:"
-	: "=&c" (d0), "=&D" (d1), "=&S" (d2)
-	: "0" (n/4), "g" (n), "1" ((long) to), "2" ((long) from)
-	: "memory");
-return (to);
+	int d0, d1, d2;
+	__asm__ __volatile__(
+		"rep ; movsl\n\t"
+		"movl %4,%%ecx\n\t"
+		"andl $3,%%ecx\n\t"
+		"jz 1f\n\t"
+		"rep ; movsb\n\t"
+		"1:"
+		: "=&c" (d0), "=&D" (d1), "=&S" (d2)
+		: "0" (n/4), "g" (n), "1" ((long)to), "2" ((long)from)
+		: "memory");
+	return to;
 }
 
 /*
  * This looks ugly, but the compiler can optimize it totally,
  * as the count is constant.
  */
-static __always_inline void * __constant_memcpy(void * to, const void * from, size_t n)
+static __always_inline void *__constant_memcpy(void *to, const void *from, size_t n)
 {
 	long esi, edi;
-	if (!n) return to;
+	if (!n)
+		return to;
 #if 1	/* want to do small copies with non-string ops? */
 	switch (n) {
-		case 1: *(char*)to = *(char*)from; return to;
-		case 2: *(short*)to = *(short*)from; return to;
-		case 4: *(int*)to = *(int*)from; return to;
+	case 1:
+		*(char *)to = *(char *)from;
+		return to;
+	case 2:
+		*(short *)to = *(short ...
From: Ingo Molnar
Date: Friday, March 21, 2008 - 5:44 am

thanks Joe, applied - it is a very nice cleanup! It zaps 76 checkpatch 
errors ...

	Ingo
--

Previous thread: [PATCH] ibmpex: Update Kconfig to list more supported models by Darrick J. Wong on Wednesday, March 12, 2008 - 6:18 pm. (1 message)

Next thread: linux list by gshan on Wednesday, March 12, 2008 - 6:56 pm. (1 message)