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,
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;
......
......@@ -250,7 +250,7 @@ static int afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd)
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);
......
......@@ -906,7 +906,7 @@ static cachefs_match_val_t afs_vlocation_cache_match(void *target,
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(void *source, void *entry)
_enter("");
struct_cpy(vldb,&vlocation->vldb);
*vldb = vlocation->vldb;
} /* end afs_vlocation_cache_update() */
#endif
......@@ -277,22 +277,6 @@ static __inline__ void *__memcpy3d(void *to, const void *from, size_t len)
#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);
......
......@@ -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 */
......
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