[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46F84F45.6000807@pobox.com>
Date: Mon, 24 Sep 2007 19:59:01 -0400
From: Jeff Garzik <jgarzik@...ox.com>
To: Kristen Carlson Accardi <kristen.c.accardi@...el.com>
CC: roel <12o3l@...cali.nl>, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
Alan <alan@...rguk.ukuu.org.uk>
Subject: Re: [patch 1/2] Enable link power management for ata drivers
Kristen Carlson Accardi wrote:
> On Tue, 25 Sep 2007 01:12:32 +0200
> roel <12o3l@...cali.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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists