diff options
author | Tejun Heo <htejun@gmail.com> | 2006-05-15 07:57:55 -0400 |
---|---|---|
committer | Tejun Heo <htejun@gmail.com> | 2006-05-15 07:57:55 -0400 |
commit | 61440db61fe4945ad9f7b32b4d6a22b17174aa1f (patch) | |
tree | 4c093d6c72facf6bc77fcedce7d8c1cb85415f5b /include | |
parent | 3373efd89dead4ce7818d685729e0431448357c9 (diff) |
[PATCH] libata: implement ATA printk helpers
Implement ata_{port|dev}_printk() which prefixes the message with
proper identification string. This change is necessary for later PM
support because devices and links should be identified differently
depending on how they are attached.
This also helps unifying device id strings. Currently, there are two
forms in use (P is the port number D device number) - 'ataP(D):', and
'ataP: dev D '. These macros also make it harder to forget proper ID
string (e.g. printing only port number when a device is in question).
Debug message handling can be integrated into these printk macros by
passing debug type and level via @lv.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/libata.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 8154b366bbd1..91e10e6b7565 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -650,7 +650,18 @@ extern void ata_eng_timeout(struct ata_port *ap); | |||
650 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | 650 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); |
651 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | 651 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); |
652 | 652 | ||
653 | /* | ||
654 | * printk helpers | ||
655 | */ | ||
656 | #define ata_port_printk(ap, lv, fmt, args...) \ | ||
657 | printk(lv"ata%u: "fmt, (ap)->id , ##args) | ||
658 | |||
659 | #define ata_dev_printk(dev, lv, fmt, args...) \ | ||
660 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args) | ||
653 | 661 | ||
662 | /* | ||
663 | * qc helpers | ||
664 | */ | ||
654 | static inline int | 665 | static inline int |
655 | ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) | 666 | ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) |
656 | { | 667 | { |