From: Lin Ming <ming.m.lin@intel.com>
To: Old <oldium.pro@seznam.cz>
Cc: Len Brown <lenb@kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] ACPI: Fixes device power states array overflow
Date: Wed, 01 Jun 2011 23:55:13 +0800 [thread overview]
Message-ID: <1306943713.2873.12.camel@hp6530s> (raw)
In-Reply-To: <201105312309.46344.oldium.pro@seznam.cz>
在 2011-06-01三的 05:09 +0800,Oldřich Jedlička写道:
> 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?
Nice catch, I have updated the patch.
Thanks.
>
> 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
prev parent reply other threads:[~2011-06-01 14:55 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
2011-06-01 15:55 ` Lin Ming [this message]
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=1306943713.2873.12.camel@hp6530s \
--to=ming.m.lin@intel.com \
--cc=error27@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=oldium.pro@seznam.cz \
/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