From: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
To: Jordan Crouse <jordan.crouse-5C7GfCeVMHo@public.gmane.org>
Cc: linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.org
Subject: Re: apm_console_blank()
Date: Tue, 29 Mar 2005 20:51:00 +0200 [thread overview]
Message-ID: <20050329185100.GB7929@elf.ucw.cz> (raw)
In-Reply-To: <20050328102035.5fcd9a61-aftB2sG12IhaqnLngUycEA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]
Hi!
> Everyone, put on your legacy helmets... :)
>
> Attached is a diff against apm.c fixing what I think was a flaw in
> the logic of the function apm_console_blank().
I guess you need to send it to APM maintainer...
Please inline your patches, its easier to comment on them that way.
--- linux-2.6.11.orig/arch/i386/kernel/apm.c 2005-03-28 10:05:01.000000000 -0700
+++ linux-2.6.11/arch/i386/kernel/apm.c 2005-03-28 10:05:12.000000000 -0700
@@ -1058,25 +1058,26 @@
* all video devices. Typically the BIOS will do laptop backlight
and * monitor powerdown for us.
*/
-
-static int apm_console_blank(int blank)
-{
- int error;
- u_short state;
+
+static int apm_console_blank(int blank) {
+
+ int error, i;
+ u_short state;
You are actually breaking formating here.
+ u_short dev[3] = { 0x100, 0x1FF, 0x101 };
state = blank ? APM_STATE_STANDBY : APM_STATE_READY;
- /* Blank the first display device */
- error = set_power_state(0x100, state);
- if ((error != APM_SUCCESS) && (error != APM_NO_ERROR)) {
- /* try to blank them all instead */
- error = set_power_state(0x1ff, state);
- if ((error != APM_SUCCESS) && (error != APM_NO_ERROR))
- /* try to blank device one instead */
- error = set_power_state(0x101, state);
+
+ for(i = 0; i < 3; i++) {
Please put space between for and (.
@@ -1089,7 +1090,8 @@
return apm_console_blank(blank);
}
}
- apm_error("set display", error);
+
+ apm_error("set display", error);
return 0;
}
...and don't do change formatting just because you can.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2005-03-29 18:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-27 22:42 [RFC] Driver States Adam Belay
[not found] ` <1111963367.3503.152.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2005-03-28 16:29 ` Jordan Crouse
[not found] ` <20050328092925.2c2736de-aftB2sG12IhaqnLngUycEA@public.gmane.org>
2005-04-01 4:01 ` David Brownell
2005-03-28 17:20 ` apm_console_blank() Jordan Crouse
[not found] ` <20050328102035.5fcd9a61-aftB2sG12IhaqnLngUycEA@public.gmane.org>
2005-03-29 18:51 ` Pavel Machek [this message]
2005-03-30 5:57 ` [RFC] Driver States Patrick Mochel
[not found] ` <Pine.LNX.4.50.0503292155120.26543-100000-x8k/2hhmB0w5etPau2IXcQ@public.gmane.org>
2005-03-30 22:45 ` Adam Belay
2005-04-05 9:24 ` Pavel Machek
2005-04-06 19:51 ` Adam Belay
2005-04-08 10:31 ` Pavel Machek
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=20050329185100.GB7929@elf.ucw.cz \
--to=pavel-+zi9xunit7i@public.gmane.org \
--cc=jordan.crouse-5C7GfCeVMHo@public.gmane.org \
--cc=linux-pm-qjLDD68F18O7TbgM5vRIOg@public.gmane.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