Re: [PATCH]Enabling Auto poweron after power is restored.
From: Linas Vepstas <hidden>
Date: 2006-12-04 19:31:18
From: Linas Vepstas <hidden>
Date: 2006-12-04 19:31:18
On Mon, Dec 04, 2006 at 09:48:58AM -0600, Will Schmidt wrote:
You could eliminate the temp variable rtas_poweron_auto_token, and
rewrite as something like:
if (rtas_token("ibm,power-off-ups") == RTAS_UNKNOWN_SERVICE) {
rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
printk(KERN_EMERG "Power-off called instead %d\n", rc );Heh. I encouraged Manish to create the temp variable in an earlier round of reviews. My personal taste is that nested subroutine calls are both ugly and hard to debug, e.g. if rtas_token() for some reason returns unexpected values, etc. --linas