[PATCH]Enabling Auto poweron after power is restored.

Linas Vepstas linas at austin.ibm.com
Tue Dec 5 06:31:14 EST 2006


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




More information about the Linuxppc-dev mailing list