public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: geert@linux-m68k.org, torvalds@osdl.org, dhowells@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: struct_cpy() and kAFS (was: Re: Linux 2.6.8-rc1)
Date: Mon, 12 Jul 2004 11:40:26 -0700	[thread overview]
Message-ID: <20040712114026.7e034cf2.akpm@osdl.org> (raw)
In-Reply-To: <20040712182315.GA28281@infradead.org>

Christoph Hellwig <hch@infradead.org> wrote:
>
> struct_cpy is used nowehre except in arch/i386/kernel/process.c and AFS,
>  so we should probably better kill it before people start using it in other
>  places.

yup.

diff -puN arch/i386/kernel/process.c~remove-struct_cpy arch/i386/kernel/process.c
--- 25/arch/i386/kernel/process.c~remove-struct_cpy	2004-07-12 11:39:05.821241928 -0700
+++ 25-akpm/arch/i386/kernel/process.c	2004-07-12 11:39:38.202319256 -0700
@@ -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	2004-07-12 11:39:05.862235696 -0700
+++ 25-akpm/include/asm-x86_64/string.h	2004-07-12 11:39:43.049582360 -0700
@@ -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	2004-07-12 11:39:05.885232200 -0700
+++ 25-akpm/include/asm-i386/string.h	2004-07-12 11:39:52.558136840 -0700
@@ -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);
 
_


  reply	other threads:[~2004-07-12 18:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-11 18:29 Linux 2.6.8-rc1 Linus Torvalds
2004-07-11 23:00 ` [PATCH] edd (Re: Linux 2.6.8-rc1) Randy.Dunlap
2004-07-12  3:02   ` Adrian Bunk
2004-07-12  4:49   ` Matt Domsch
2004-07-12  5:21     ` Randy.Dunlap
2004-07-12  9:26 ` Linux 2.6.8-rc1 Matthias Andree
2004-07-12 18:54   ` Martin Schlemmer
2004-07-12  9:34 ` Paolo Ciarrocchi
2004-07-12 15:42   ` Adrian Bunk
2004-07-12 15:56     ` Paolo Ciarrocchi
2004-07-12 16:34       ` Adrian Bunk
2004-07-12 16:43         ` Linus Torvalds
2004-07-12 20:28           ` Paolo Ciarrocchi
2004-07-12 20:22         ` Paolo Ciarrocchi
2004-07-13 20:54       ` cliff white
2004-07-12 21:08     ` Horst von Brand
2004-07-12 11:30 ` is_highmem() and WANT_PAGE_VIRTUAL (was: Re: Linux 2.6.8-rc1) Geert Uytterhoeven
2004-07-12 13:51   ` Andy Whitcroft
2004-07-12 14:23     ` Geert Uytterhoeven
2004-07-12 12:01 ` Linux 2.6.8-rc1 Geert Uytterhoeven
2004-07-12 13:18   ` OGAWA Hirofumi
2004-07-12 13:25     ` Geert Uytterhoeven
2004-07-12 14:02       ` OGAWA Hirofumi
2004-07-12 13:23 ` struct_cpy() and kAFS (was: Re: Linux 2.6.8-rc1) Geert Uytterhoeven
2004-07-12 18:11   ` Andrew Morton
2004-07-12 18:23     ` Christoph Hellwig
2004-07-12 18:40       ` Andrew Morton [this message]
2004-07-13 10:14     ` David Howells
2004-07-12 23:49 ` Linux 2.6.8-rc1 (compile stats) John Cherry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040712114026.7e034cf2.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox