Commit 6b566c8b authored by Bodo Stroesser's avatar Bodo Stroesser Committed by Linus Torvalds

[PATCH] UML: Use va_copy

In arch/um/kernel/skas/uaccess.c, the simple assignment
   va_list args = *((va_list *) arg_ptr);
is used in do_buffer_op() to obtain a copy of a va_list, that
was delivered as a pointer only.
But this construction doesn't compile on s390. Instead,
va_copy() and va_end() should be used (see "man va_start").
Signed-off-by: default avatarBodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent eac56c48
......@@ -54,15 +54,23 @@ static int do_op(unsigned long addr, int len, int is_write,
static void do_buffer_op(void *jmpbuf, void *arg_ptr)
{
va_list args = *((va_list *) arg_ptr);
unsigned long addr = va_arg(args, unsigned long);
int len = va_arg(args, int);
int is_write = va_arg(args, int);
int (*op)(unsigned long, int, void *) = va_arg(args, void *);
void *arg = va_arg(args, void *);
int *res = va_arg(args, int *);
int size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len);
int remain = len, n;
va_list args;
unsigned long addr;
int len, is_write, size, remain, n;
int (*op)(unsigned long, int, void *);
void *arg;
int *res;
va_copy(args, *(va_list *)arg_ptr);
addr = va_arg(args, unsigned long);
len = va_arg(args, int);
is_write = va_arg(args, int);
op = va_arg(args, void *);
arg = va_arg(args, void *);
res = va_arg(args, int *);
va_end(args);
size = min(PAGE_ALIGN(addr) - addr, (unsigned long) len);
remain = len;
current->thread.fault_catcher = jmpbuf;
n = do_op(addr, size, is_write, op, arg);
......
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