linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 15/28] UML - Use va_copy
@ 2005-01-10  7:35 Jeff Dike
  0 siblings, 0 replies; only message in thread
From: Jeff Dike @ 2005-01-10  7:35 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, bstroesser

From: Bodo Stroesser <bstroesser@fujitsu-siemens.com>

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: Bodo Stroesser <bstroesser@fujitsu-siemens.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: 2.6.10/arch/um/kernel/skas/uaccess.c
===================================================================
--- 2.6.10.orig/arch/um/kernel/skas/uaccess.c	2005-01-03 12:56:15.000000000 -0500
+++ 2.6.10/arch/um/kernel/skas/uaccess.c	2005-01-03 12:57:59.000000000 -0500
@@ -54,15 +54,23 @@
 
 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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-10  5:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-10  7:35 [PATCH 15/28] UML - Use va_copy Jeff Dike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).