Commit 6dd25783 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove struct_cpy()

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

Remove struct_cpy() altogether, and use structure assignments.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3d42bd9d
...@@ -353,7 +353,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp, ...@@ -353,7 +353,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
int err; int err;
childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
struct_cpy(childregs, regs); *childregs = *regs;
childregs->eax = 0; childregs->eax = 0;
childregs->esp = esp; childregs->esp = esp;
p->set_child_tid = p->clear_child_tid = NULL; p->set_child_tid = p->clear_child_tid = NULL;
......
...@@ -250,7 +250,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) ...@@ -250,7 +250,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
if (IS_ERR(newmnt)) if (IS_ERR(newmnt))
return PTR_ERR(newmnt); return PTR_ERR(newmnt);
struct_cpy(&newnd, nd); newnd = *nd;
newnd.dentry = dentry; newnd.dentry = dentry;
err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts); err = do_add_mount(newmnt, &newnd, 0, &afs_vfsmounts);
......
...@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation_cache_match(void *target, ...@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation_cache_match(void *target,
if (!vlocation->valid || if (!vlocation->valid ||
vlocation->vldb.rtime == vldb->rtime vlocation->vldb.rtime == vldb->rtime
) { ) {
struct_cpy(&vlocation->vldb, vldb); vlocation->vldb = *vldb;
vlocation->valid = 1; vlocation->valid = 1;
_leave(" = SUCCESS [c->m]"); _leave(" = SUCCESS [c->m]");
return CACHEFS_MATCH_SUCCESS; return CACHEFS_MATCH_SUCCESS;
...@@ -947,7 +947,7 @@ static void afs_vlocation_cache_update(void *source, void *entry) ...@@ -947,7 +947,7 @@ static void afs_vlocation_cache_update(void *source, void *entry)
_enter(""); _enter("");
struct_cpy(vldb,&vlocation->vldb); *vldb = vlocation->vldb;
} /* end afs_vlocation_cache_update() */ } /* end afs_vlocation_cache_update() */
#endif #endif
...@@ -277,22 +277,6 @@ static __inline__ void *__memcpy3d(void *to, const void *from, size_t len) ...@@ -277,22 +277,6 @@ static __inline__ void *__memcpy3d(void *to, const void *from, size_t len)
#endif #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 #define __HAVE_ARCH_MEMMOVE
void *memmove(void * dest,const void * src, size_t n); void *memmove(void * dest,const void * src, size_t n);
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#define struct_cpy(x,y) (*(x)=*(y))
/* Written 2002 by Andi Kleen */ /* Written 2002 by Andi Kleen */
/* Only used for special circumstances. Stolen from i386/string.h */ /* Only used for special circumstances. Stolen from i386/string.h */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment