public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, Len Brown <lenb@kernel.org>,
	Tejun Heo <htejun@gmail.com>, Jeff Garzik <jgarzik@pobox.com>,
	linux-ide <linux-ide@vger.kernel.org>,
	linux acpi <linux-acpi@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH]libata-acpi: add ACPI _PSx method
Date: Mon, 05 Nov 2007 09:26:12 +0800	[thread overview]
Message-ID: <1194225972.32766.6.camel@sli10-conroe.sh.intel.com> (raw)
In-Reply-To: <200711021216.03088.rjw@sisk.pl>

On Fri, 2007-11-02 at 12:16 +0100, Rafael J. Wysocki wrote:
> > 
> > Index: linux/drivers/ata/libata-acpi.c
> > ===================================================================
> > --- linux.orig/drivers/ata/libata-acpi.c	2007-11-01 10:54:25.000000000 +0800
> > +++ linux/drivers/ata/libata-acpi.c	2007-11-02 09:14:12.000000000 +0800
> > @@ -652,6 +652,35 @@ void ata_acpi_on_resume(struct ata_port 
> >  }
> >  
> >  /**
> > + * ata_acpi_set_state - set the port power state
> > + * @ap: target ATA port
> > + * @state: state, on/off
> > + *
> > + * This function executes the _PS0/_PS3 ACPI method to set the power state.
> > + * ACPI spec requires _PS0 when IDE power on and _PS3 when power off
> > + */
> > +void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
> 
> I wouldn't use pm_message_t here.
> 
> We're seriously considering removing it in the future and the caller passes
> constants explicitly anyway.
> 
> IMO, it might be cleaner to define two separate functions, one for switching
> to D0 and one for switching to D3, and call them as appropriate.  Then, you
> could get rid of some conditionals below.
It doesn't make sense to add a new one just for ata_acpi and we don't
misuse pm_message_t here. If you will remove it, lets clean up it then.

Thanks,
Shaohua

  reply	other threads:[~2007-11-05  1:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14  2:45 [PATCH]libata-acpi: add ACPI _PSx method Shaohua Li
2007-09-14  3:21 ` Jeff Garzik
2007-09-14  3:11   ` Shaohua Li
2007-09-20 22:00 ` Jeff Garzik
2007-09-21  1:16   ` Shaohua Li
2007-09-21  2:20     ` Tejun Heo
2007-09-21  2:17       ` Shaohua Li
2007-10-31  2:27         ` Len Brown
2007-10-31 13:26           ` Rafael J. Wysocki
2007-11-01  2:50             ` Shaohua Li
2007-11-01 10:04               ` Alan Cox
2007-11-02  1:32                 ` Shaohua Li
2007-11-02 11:16                   ` Rafael J. Wysocki
2007-11-05  1:26                     ` Shaohua Li [this message]
2007-11-03 13:00                   ` Jeff Garzik
2007-11-05  1:12                     ` Shaohua Li

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=1194225972.32766.6.camel@sli10-conroe.sh.intel.com \
    --to=shaohua.li@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=htejun@gmail.com \
    --cc=jgarzik@pobox.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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