linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: akpm@osdl.org
Cc: linas@austin.ibm.com, linuxppc64-dev@lists.linuxppc.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] PPC64: Janitor log_rtas_error() call arguments
Date: Wed, 30 Jun 2004 22:11:33 +1000	[thread overview]
Message-ID: <16610.44533.113909.519100@cargo.ozlabs.ibm.com> (raw)

This patch from Linas Vepstas (rediffed by me) fixes the confusing
argument aliasing of the log_rtas_error() subroutine.

This patch makes no functional changes, it just cleans up some 
strange usage.

The rtas_args used to communicate with firmware are always taken
from the paca struct, so as to keep the args at a fixed, low-memory 
location.  But the log_rtas_error() routine also took an rtas_args
pointer, which it assumed was aliased to the paca struct.  This
aliasing is both un-neccessary, and confusing; this patch eliminates
this confusion.

Signed-off-by: Linas Vepstas <linas@linas.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

diff -urN linux-2.5/arch/ppc64/kernel/rtas.c ppc64-2.5-pseries/arch/ppc64/kernel/rtas.c
--- linux-2.5/arch/ppc64/kernel/rtas.c	2004-06-30 22:00:43.437979400 +1000
+++ ppc64-2.5-pseries/arch/ppc64/kernel/rtas.c	2004-06-30 21:55:51.000000000 +1000
@@ -75,9 +75,9 @@
 
 
 static int
-__log_rtas_error(struct rtas_args *rtas_args)
+__log_rtas_error(void)
 {
-	struct rtas_args err_args, temp_args;
+	struct rtas_args err_args, save_args;
 
 	err_args.token = rtas_token("rtas-last-error");
 	err_args.nargs = 2;
@@ -88,7 +88,7 @@
 	err_args.args[1] = RTAS_ERROR_LOG_MAX;
 	err_args.args[2] = 0;
 
-	temp_args = *rtas_args;
+	save_args = rtas.args;
 	rtas.args = err_args;
 
 	PPCDBG(PPCDBG_RTAS, "\tentering rtas with 0x%lx\n",
@@ -97,19 +97,19 @@
 	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
 	err_args = rtas.args;
-	rtas.args = temp_args;
+	rtas.args = save_args;
 
 	return err_args.rets[0];
 }
 
 void
-log_rtas_error(struct rtas_args	*rtas_args)
+log_rtas_error(void)
 {
 	unsigned long s;
 	int rc;
 
 	spin_lock_irqsave(&rtas.lock, s);
-	rc = __log_rtas_error(rtas_args);
+	rc = __log_rtas_error();
 	spin_unlock_irqrestore(&rtas.lock, s);
 	if (rc == 0)
 		log_error(rtas_err_buf, ERR_TYPE_RTAS_LOG, 0);
@@ -155,7 +155,7 @@
 	PPCDBG(PPCDBG_RTAS, "\treturned from rtas ...\n");
 
 	if (rtas_args->rets[0] == -1)
-		logit = (__log_rtas_error(rtas_args) == 0);
+		logit = (__log_rtas_error() == 0);
 
 	ifppcdebug(PPCDBG_RTAS) {
 		for(i=0; i < nret ;i++)
@@ -447,7 +447,7 @@
 
 	args.rets  = (rtas_arg_t *)&(args.args[nargs]);
 	if (args.rets[0] == -1)
-		log_rtas_error(&args);
+		log_rtas_error();
 
 	/* Copy out args. */
 	if (copy_to_user(uargs->args + nargs,

             reply	other threads:[~2004-06-30 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-30 12:11 Paul Mackerras [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-29 21:41 [PATCH] PPC64: Janitor log_rtas_error() call arguments linas

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=16610.44533.113909.519100@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=akpm@osdl.org \
    --cc=linas@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.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).