@@ -53,7 +53,8 @@ static size_t sdev_format_header(char *logbuf, size_t logbuf_len,
return off;
}
-void sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
+
+void _sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
const char *name, const char *fmt, ...)
{
va_list args;
@@ -75,10 +76,10 @@ void sdev_prefix_printk(const char *level, const struct scsi_device *sdev,
off += vscnprintf(logbuf + off, logbuf_len - off, fmt, args);
va_end(args);
}
- dev_printk(level, &sdev->sdev_gendev, "%s", logbuf);
+ _dev_printk(level, &sdev->sdev_gendev, "%s", logbuf);
scsi_log_release_buffer(logbuf);
}
-EXPORT_SYMBOL(sdev_prefix_printk);
+EXPORT_SYMBOL(_sdev_prefix_printk);
void scmd_printk(const char *level, const struct scsi_cmnd *scmd,
const char *fmt, ...)
@@ -263,9 +263,15 @@ struct scsi_device {
* as a string pointer
*/
__printf(4, 5) void
-sdev_prefix_printk(const char *, const struct scsi_device *, const char *,
+_sdev_prefix_printk(const char *, const struct scsi_device *, const char *,
const char *, ...);
+#define sdev_prefix_printk(level, sdev, name, fmt, ...) \
+({ \
+ printk_index_subsys_emit("%s %s: [%s] ", level, fmt); \
+ _sdev_prefix_printk(level, sdev, name, fmt, ##__VA_ARGS__); \
+})
+
#define sdev_printk(l, sdev, fmt, a...) \
sdev_prefix_printk(l, sdev, NULL, fmt, ##a)