linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: roel <12o3l@tiscali.nl>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, Alan <alan@lxorguk.ukuu.org.uk>
Subject: Re: [patch 1/2] Enable link power management for ata drivers
Date: Mon, 24 Sep 2007 19:59:01 -0400	[thread overview]
Message-ID: <46F84F45.6000807@pobox.com> (raw)
In-Reply-To: <20070924164118.803cfb22.kristen.c.accardi@intel.com>

Kristen Carlson Accardi wrote:
> On Tue, 25 Sep 2007 01:12:32 +0200
> roel <12o3l@tiscali.nl> wrote:
> 
>>>  #define ata_id_cdb_intr(id)	(((id)[0] & 0x60) == 0x20)
>>> +#define ata_id_has_hipm(id)	\
>>> +	( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
>>> +	  ((id)[76] & (1 << 9)) )
>> 		^
>> 		|
>> are you sure this
>> should be 76?
> 
> Yes.
> 
>> we can also change the first statement a bit:
>> 	(!(((id)[76] == 0x0000) || ((id)[76] == 0xffff)) && \
>>
>>
>>> +#define ata_id_has_dipm(id)	\
>>> +	( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
>> and:
>> 	(!(((id)[76] == 0x0000) || ((id)[76] == 0xffff)) && \
> 
> I feel this is equivalent functionality and not as readable.

Poke around for Alan Cox's cleanup of this area of linux/ata.h.

It converts several macros to inline functions (encouraged), and also 
illustrates a nice, clean way of testing an ID word's validity. 
[obviously the final implementation varies, depending on that ID word's 
history]

Alan or Andrew, got a copy somewhere?  My feeble search skills don't 
seem to turn it up at the moment, even though I had a copy in my hands 
quite recently.

	Jeff



  reply	other threads:[~2007-09-24 23:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070924215140.966161778@intel.com>
2007-09-24 22:13 ` [patch 1/2] Enable link power management for ata drivers Kristen Carlson Accardi
2007-09-24 23:12   ` roel
2007-09-24 23:28     ` Davide Libenzi
2007-09-25  0:00       ` roel
2007-09-24 23:41     ` Kristen Carlson Accardi
2007-09-24 23:59       ` Jeff Garzik [this message]
2007-09-25  9:50         ` Alan Cox
2007-09-26  2:45           ` Jeff Garzik
2007-10-25  5:21   ` Jeff Garzik
2007-09-24 22:14 ` [patch 2/2] Enable Aggressive Link Power management for AHCI controllers Kristen Carlson Accardi
2007-10-25  5:34   ` Jeff Garzik

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=46F84F45.6000807@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=12o3l@tiscali.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).