All of lore.kernel.org
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Paul Mackerras <paulus@samba.org>
Cc: ppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 2/6] pseries: use rtas_token instead of hand-rolled code
Date: Wed, 8 Aug 2007 15:02:10 -0500	[thread overview]
Message-ID: <20070808200210.GB20134@austin.ibm.com> (raw)
In-Reply-To: <20070808200115.GA20134@austin.ibm.com>


The rtas_token() call does the same thing as this hand-rolled code.
This makes the code easier to read.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>

----
 arch/powerpc/platforms/pseries/rtasd.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Index: linux-2.6.22-git2/arch/powerpc/platforms/pseries/rtasd.c
===================================================================
--- linux-2.6.22-git2.orig/arch/powerpc/platforms/pseries/rtasd.c	2007-08-07 17:57:13.000000000 -0500
+++ linux-2.6.22-git2/arch/powerpc/platforms/pseries/rtasd.c	2007-08-07 17:57:49.000000000 -0500
@@ -361,26 +361,17 @@ static int enable_surveillance(int timeo
 
 static int get_eventscan_parms(void)
 {
-	struct device_node *node;
-	const int *ip;
-
-	node = of_find_node_by_path("/rtas");
-
-	ip = of_get_property(node, "rtas-event-scan-rate", NULL);
-	if (ip == NULL) {
+	rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
+	if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
 		printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
-		of_node_put(node);
 		return -1;
 	}
-	rtas_event_scan_rate = *ip;
 	DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
 
 	/* Make room for the sequence number */
 	rtas_error_log_max = rtas_get_error_log_max();
 	rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
 
-	of_node_put(node);
-
 	return 0;
 }
 

  reply	other threads:[~2007-08-08 20:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 19:59 [PATCH 0/6] pseries: rtas & nvram cleanup/simpilification Linas Vepstas
2007-08-08 20:01 ` [PATCH 1/6] pseries: avoid excess rtas calls Linas Vepstas
2007-08-08 20:02   ` Linas Vepstas [this message]
2007-08-08 20:03     ` [PATCH 3/6] pseries: simplify rtasd initialization Linas Vepstas
2007-08-08 20:04       ` [PATCH 4/6] powerpc: remove nvram forward declarations Linas Vepstas
2007-08-08 20:06         ` [PATCH 5/6] pseries: fix jumbled no_logging flag Linas Vepstas
2007-08-08 20:07           ` [PATCH 6/6] pseries: eliminate global var Linas Vepstas
2007-08-08 21:57             ` Nathan Lynch
2007-08-08 22:22               ` Linas Vepstas
2007-08-09  1:02                 ` Nathan Lynch
2007-08-09 20:56                   ` [PATCH 6/6 v2] " Linas Vepstas
2007-08-08 21:57   ` [PATCH 1/6] pseries: avoid excess rtas calls Nathan Lynch
2007-08-08 22:20     ` Linas Vepstas
2007-08-09 21:01       ` [PATCH 1/6 v2] " Linas Vepstas

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=20070808200210.GB20134@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.