From: "Oldřich Jedlička" <oldium.pro@seznam.cz>
To: Lin Ming <ming.m.lin@intel.com>
Cc: Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] ACPI: Fixes device power states array overflow
Date: Tue, 31 May 2011 23:09:45 +0200 [thread overview]
Message-ID: <201105312309.46344.oldium.pro@seznam.cz> (raw)
In-Reply-To: <1306762961.2244.13.camel@localhost>
Hi Lin,
On Monday 30 May 2011 at 15:42:41, Lin Ming wrote:
> Commit 28c2103 added new state ACPI_STATE_D3_COLD, so the device power
> states array must be expanded by one also.
>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> ---
> include/acpi/acpi_bus.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 3a10ef5..ff246e8 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -210,7 +210,7 @@ struct acpi_device_power_state {
> struct acpi_device_power {
> int state; /* Current state */
> struct acpi_device_power_flags flags;
> - struct acpi_device_power_state states[4]; /* Power states (D0-D3) */
> + struct acpi_device_power_state states[5]; /* Power states (D0-D3Cold)
*/
Wouldn't it be better to use some constant, so that the same problem would not
appear again in future - something like ACPI_D_STATE_COUNT or (maybe better)
ACPI_D_STATES_MAX+1 instead of magic number 5?
Cheers,
Oldřich.
> };
>
> /* Performance Management */
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-31 21:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-30 13:42 [PATCH] ACPI: Fixes device power states array overflow Lin Ming
2011-05-31 21:09 ` Oldřich Jedlička [this message]
2011-06-01 15:55 ` Lin Ming
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=201105312309.46344.oldium.pro@seznam.cz \
--to=oldium.pro@seznam.cz \
--cc=error27@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=ming.m.lin@intel.com \
/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