From: Matthew Dobson <colpatch@us.ibm.com>
To: swsusp@lister.fornax.hu, linux-kernel@vger.kernel.org
Cc: "Martin J. Bligh" <mbligh@aracnet.com>
Subject: [patch] incorrect state check?
Date: Tue, 24 Jun 2003 16:06:08 -0700 [thread overview]
Message-ID: <3EF8D960.6060002@us.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 487 bytes --]
Hi swsusp'ers... I've been looking through some software suspend code,
and I think there's an error in acpi_suspend. The code is checking that
we're trying to move into a valid state. The check now reads:
if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3 || ACPI_STATE_S4) {
/* do stuff */
}
This check will always be true, since ACPI_STATE_S4 is defined to be 4.
The attatched patch fixes this bug by putting a 'state == ' in front of
the 'ACPI_STATE_S4'.
Cheers!
-Matt
[-- Attachment #2: bad_swsusp_state_check.patch --]
[-- Type: text/plain, Size: 788 bytes --]
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.5.73-vanilla/drivers/acpi/sleep/main.c linux-2.5.73-swsusp/drivers/acpi/sleep/main.c
--- linux-2.5.73-vanilla/drivers/acpi/sleep/main.c Sun Jun 22 11:32:30 2003
+++ linux-2.5.73-swsusp/drivers/acpi/sleep/main.c Tue Jun 24 15:58:58 2003
@@ -238,7 +238,7 @@ acpi_suspend (
/* do we have a wakeup address for S2 and S3? */
/* Here, we support only S4BIOS, those we set the wakeup address */
/* S4OS is only supported for now via swsusp.. */
- if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3 || ACPI_STATE_S4) {
+ if (state == ACPI_STATE_S2 || state == ACPI_STATE_S3 || state == ACPI_STATE_S4) {
if (!acpi_wakeup_address)
return AE_ERROR;
acpi_set_firmware_waking_vector((acpi_physical_address) acpi_wakeup_address);
reply other threads:[~2003-06-24 22:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3EF8D960.6060002@us.ibm.com \
--to=colpatch@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
--cc=swsusp@lister.fornax.hu \
/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.