

Only two architectures implement it, so afs broke the build.

Remove struct_cpy() altogether, and use structure assignments.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/i386/kernel/process.c  |    2 +-
 25-akpm/fs/afs/mntpt.c              |    2 +-
 25-akpm/fs/afs/vlocation.c          |    4 ++--
 25-akpm/include/asm-i386/string.h   |   16 ----------------
 25-akpm/include/asm-x86_64/string.h |    2 --
 5 files changed, 4 insertions(+), 22 deletions(-)

diff -puN arch/i386/kernel/process.c~remove-struct_cpy arch/i386/kernel/process.c
--- 25/arch/i386/kernel/process.c~remove-struct_cpy	Mon Jul 12 15:52:19 2004
+++ 25-akpm/arch/i386/kernel/process.c	Mon Jul 12 15:52:19 2004
@@ -355,7 +355,7 @@ int copy_thread(int nr, unsigned long cl
 	int err;
 
 	childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
-	struct_cpy(childregs, regs);
+	*childregs = *regs;
 	childregs->eax = 0;
 	childregs->esp = esp;
 	p->set_child_tid = p->clear_child_tid = NULL;
diff -puN include/asm-x86_64/string.h~remove-struct_cpy include/asm-x86_64/string.h
--- 25/include/asm-x86_64/string.h~remove-struct_cpy	Mon Jul 12 15:52:19 2004
+++ 25-akpm/include/asm-x86_64/string.h	Mon Jul 12 15:52:19 2004
@@ -3,8 +3,6 @@
 
 #ifdef __KERNEL__
 
-#define struct_cpy(x,y) (*(x)=*(y))
-
 /* Written 2002 by Andi Kleen */ 
 
 /* Only used for special circumstances. Stolen from i386/string.h */ 
diff -puN include/asm-i386/string.h~remove-struct_cpy include/asm-i386/string.h
--- 25/include/asm-i386/string.h~remove-struct_cpy	Mon Jul 12 15:52:19 2004
+++ 25-akpm/include/asm-i386/string.h	Mon Jul 12 15:52:19 2004
@@ -277,22 +277,6 @@ static __inline__ void *__memcpy3d(void 
 
 #endif
 
-/*
- * struct_cpy(x,y), copy structure *x into (matching structure) *y.
- *
- * We get link-time errors if the structure sizes do not match.
- * There is no runtime overhead, it's all optimized away at
- * compile time.
- */
-extern void __struct_cpy_bug (void);
-
-#define struct_cpy(x,y) 			\
-({						\
-	if (sizeof(*(x)) != sizeof(*(y))) 	\
-		__struct_cpy_bug();		\
-	memcpy(x, y, sizeof(*(x)));		\
-})
-
 #define __HAVE_ARCH_MEMMOVE
 void *memmove(void * dest,const void * src, size_t n);
 
diff -puN fs/afs/mntpt.c~remove-struct_cpy fs/afs/mntpt.c
--- 25/fs/afs/mntpt.c~remove-struct_cpy	Mon Jul 12 15:52:22 2004
+++ 25-akpm/fs/afs/mntpt.c	Mon Jul 12 15:52:22 2004
@@ -250,7 +250,7 @@ static int afs_mntpt_follow_link(struct 
 	if (IS_ERR(newmnt))
 		return PTR_ERR(newmnt);
 
-	struct_cpy(&newnd, nd);
+	newnd = *nd;
 	newnd.dentry = dentry;
 	err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);
 
diff -puN fs/afs/vlocation.c~remove-struct_cpy fs/afs/vlocation.c
--- 25/fs/afs/vlocation.c~remove-struct_cpy	Mon Jul 12 15:52:22 2004
+++ 25-akpm/fs/afs/vlocation.c	Mon Jul 12 15:52:22 2004
@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation
 		if (!vlocation->valid ||
 		    vlocation->vldb.rtime == vldb->rtime
 		    ) {
-			struct_cpy(&vlocation->vldb, vldb);
+			vlocation->vldb = *vldb;
 			vlocation->valid = 1;
 			_leave(" = SUCCESS [c->m]");
 			return CACHEFS_MATCH_SUCCESS;
@@ -947,7 +947,7 @@ static void afs_vlocation_cache_update(v
 
 	_enter("");
 
-	struct_cpy(vldb,&vlocation->vldb);
+	*vldb = vlocation->vldb;
 
 } /* end afs_vlocation_cache_update() */
 #endif
_
