Commit e9c527163d31da9f616e989a90429729525c5233

Authored by Paolo 'Blaisorblade' Giarrusso
Committed by Linus Torvalds
1 parent c16993d900

[PATCH] uml: move va_copy conditional def

GCC 2.95 uses __va_copy instead of va_copy.  Handle it inside compiler.h
instead of in a casual file, and avoid the risk that this breaks with a newer
compiler (which it could do).

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 7 additions and 2 deletions Side-by-side Diff

arch/um/kernel/skas/uaccess.c
... ... @@ -3,6 +3,7 @@
3 3 * Licensed under the GPL
4 4 */
5 5  
  6 +#include "linux/compiler.h"
6 7 #include "linux/stddef.h"
7 8 #include "linux/kernel.h"
8 9 #include "linux/string.h"
... ... @@ -61,8 +62,7 @@
61 62 void *arg;
62 63 int *res;
63 64  
64   - /* Some old gccs recognize __va_copy, but not va_copy */
65   - __va_copy(args, *(va_list *)arg_ptr);
  65 + va_copy(args, *(va_list *)arg_ptr);
66 66 addr = va_arg(args, unsigned long);
67 67 len = va_arg(args, int);
68 68 is_write = va_arg(args, int);
include/linux/compiler-gcc2.h
... ... @@ -22,4 +22,9 @@
22 22 # define __attribute_pure__ __attribute__((pure))
23 23 # define __attribute_const__ __attribute__((__const__))
24 24 #endif
  25 +
  26 +/* GCC 2.95.x/2.96 recognize __va_copy, but not va_copy. Actually later GCC's
  27 + * define both va_copy and __va_copy, but the latter may go away, so limit this
  28 + * to this header */
  29 +#define va_copy __va_copy