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
-