linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, bstroesser@fujitsu-siemens.com
Subject: [PATCH 15/28] UML - Use va_copy
Date: Mon, 10 Jan 2005 02:35:48 -0500	[thread overview]
Message-ID: <200501100735.j0A7ZmPW005805@ccure.user-mode-linux.org> (raw)

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);


                 reply	other threads:[~2005-01-10  5:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200501100735.j0A7ZmPW005805@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=akpm@osdl.org \
    --cc=bstroesser@fujitsu-siemens.com \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).