Got too many complaints that this code is ugly. It is. Fix it. Signed-off-by: Zachary Amsden <zach@vmware.com> Index: linux-2.6.13/include/asm-i386/desc.h ==================================================================--- linux-2.6.13.orig/include/asm-i386/desc.h 2005-08-08 14:12:48.000000000 -0700 +++ linux-2.6.13/include/asm-i386/desc.h 2005-08-08 14:53:11.000000000 -0700 @@ -106,15 +106,9 @@ ldt[entry].b = entry_b; } -#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); } static inline void clear_LDT(void)