diff options
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 56 |
1 files changed, 42 insertions, 14 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5a9926b34072..4e72a6af70b5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1244,20 +1244,48 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1244 | /* | 1244 | /* |
1245 | * printk helpers | 1245 | * printk helpers |
1246 | */ | 1246 | */ |
1247 | #define ata_port_printk(ap, lv, fmt, args...) \ | 1247 | __attribute__((format (printf, 3, 4))) |
1248 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1248 | int ata_port_printk(const struct ata_port *ap, const char *level, |
1249 | 1249 | const char *fmt, ...); | |
1250 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1250 | __attribute__((format (printf, 3, 4))) |
1251 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ | 1251 | int ata_link_printk(const struct ata_link *link, const char *level, |
1252 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1252 | const char *fmt, ...); |
1253 | (link)->pmp , ##args); \ | 1253 | __attribute__((format (printf, 3, 4))) |
1254 | else \ | 1254 | int ata_dev_printk(const struct ata_device *dev, const char *level, |
1255 | printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ | 1255 | const char *fmt, ...); |
1256 | } while(0) | 1256 | |
1257 | 1257 | #define ata_port_err(ap, fmt, ...) \ | |
1258 | #define ata_dev_printk(dev, lv, fmt, args...) \ | 1258 | ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__) |
1259 | printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ | 1259 | #define ata_port_warn(ap, fmt, ...) \ |
1260 | (dev)->link->pmp + (dev)->devno , ##args) | 1260 | ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__) |
1261 | #define ata_port_notice(ap, fmt, ...) \ | ||
1262 | ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1263 | #define ata_port_info(ap, fmt, ...) \ | ||
1264 | ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1265 | #define ata_port_dbg(ap, fmt, ...) \ | ||
1266 | ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1267 | |||
1268 | #define ata_link_err(link, fmt, ...) \ | ||
1269 | ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1270 | #define ata_link_warn(link, fmt, ...) \ | ||
1271 | ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1272 | #define ata_link_notice(link, fmt, ...) \ | ||
1273 | ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1274 | #define ata_link_info(link, fmt, ...) \ | ||
1275 | ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1276 | #define ata_link_dbg(link, fmt, ...) \ | ||
1277 | ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1278 | |||
1279 | #define ata_dev_err(dev, fmt, ...) \ | ||
1280 | ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1281 | #define ata_dev_warn(dev, fmt, ...) \ | ||
1282 | ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1283 | #define ata_dev_notice(dev, fmt, ...) \ | ||
1284 | ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1285 | #define ata_dev_info(dev, fmt, ...) \ | ||
1286 | ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1287 | #define ata_dev_dbg(dev, fmt, ...) \ | ||
1288 | ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1261 | 1289 | ||
1262 | /* | 1290 | /* |
1263 | * ata_eh_info helpers | 1291 | * ata_eh_info helpers |