From: Zachary Amsden <zach@vmware.com>

Got too many complaints that this code is ugly.  It is.  Fix it.

Signed-off-by: Zachary Amsden <zach@vmware.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 include/asm-i386/mach-default/mach_desc.h |    8 +-------
 1 files changed, 1 insertion(+), 7 deletions(-)

diff -puN include/asm-i386/mach-default/mach_desc.h~i386--remove-ugly-tls-code include/asm-i386/mach-default/mach_desc.h
--- 25/include/asm-i386/mach-default/mach_desc.h~i386--remove-ugly-tls-code	Wed Aug 17 13:33:39 2005
+++ 25-akpm/include/asm-i386/mach-default/mach_desc.h	Wed Aug 17 13:33:39 2005
@@ -70,15 +70,9 @@ static inline int write_ldt_entry(void *
 	return 0;
 }
 
-#if TLS_SIZE != 24
-# error update this code.
-#endif
-
 static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
 {
-#define C(i) per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN + i] = t->tls_array[i]
-	C(0); C(1); C(2);
-#undef C
+	memcpy(&per_cpu(cpu_gdt_table, cpu)[GDT_ENTRY_TLS_MIN], t->tls_array, TLS_SIZE);
 }
 
 #endif
_