We should be using the standard dev_printk() variants for
sense code printing.
Signed-off-by: Hannes Reinecke h...@suse.de
---
drivers/scsi/53c700.c | 2 +-
drivers/scsi/ch.c | 2 +-
drivers/scsi/constants.c | 113 +
drivers/scsi/osst.c| 8 ++--
drivers/scsi/scsi.c| 2 +-
drivers/scsi/scsi_error.c | 2 +-
drivers/scsi/scsi_ioctl.c | 2 +-
drivers/scsi/scsi_lib.c| 4 +-
drivers/scsi/sd.c | 9 ++--
drivers/scsi/sg.c | 2 +-
drivers/scsi/sr_ioctl.c| 6 +--
drivers/scsi/st.c | 6 ++-
drivers/scsi/storvsc_drv.c | 3 +-
include/scsi/scsi_dbg.h| 17 ---
14 files changed, 91 insertions(+), 87 deletions(-)
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index fabd4be..68bf423 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -602,7 +602,7 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
#ifdef NCR_700_DEBUG
printk( ORIGINAL CMD %p RETURNED %d, new return is %d
sense is\n,
SCp, SCp-cmnd[7], result);
- scsi_print_sense(53c700, SCp);
+ scsi_print_sense(SCp);
#endif
dma_unmap_single(hostdata-dev, slot-dma_handle,
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index ef5ae0d..eea94a9 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -207,7 +207,7 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
DPRINTK(result: 0x%x\n,result);
if (driver_byte(result) DRIVER_SENSE) {
if (debug)
- scsi_print_sense_hdr(ch-name, sshdr);
+ scsi_print_sense_hdr(ch-device, ch-name, sshdr);
errno = ch_find_errno(sshdr);
switch(sshdr.sense_key) {
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 2f44707..36e1ffd 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -1292,18 +1292,19 @@ static const struct error_info additional[] =
struct error_info2 {
unsigned char code1, code2_min, code2_max;
+ const char * str;
const char * fmt;
};
static const struct error_info2 additional2[] =
{
- {0x40, 0x00, 0x7f, Ram failure (%x)},
- {0x40, 0x80, 0xff, Diagnostic failure on component (%x)},
- {0x41, 0x00, 0xff, Data path failure (%x)},
- {0x42, 0x00, 0xff, Power-on or self-test failure (%x)},
- {0x4D, 0x00, 0xff, Tagged overlapped commands (task tag %x)},
- {0x70, 0x00, 0xff, Decompression exception short algorithm id of %x},
- {0, 0, 0, NULL}
+ {0x40, 0x00, 0x7f, Ram failure, },
+ {0x40, 0x80, 0xff, Diagnostic failure on component, },
+ {0x41, 0x00, 0xff, Data path failure, },
+ {0x42, 0x00, 0xff, Power-on or self-test failure, },
+ {0x4D, 0x00, 0xff, Tagged overlapped commands, task tag },
+ {0x70, 0x00, 0xff, Decompression exception, short algorithm id of },
+ {0, 0, 0, NULL, NULL}
};
/* description of the sense key values */
@@ -1349,7 +1350,8 @@ EXPORT_SYMBOL(scsi_sense_key_string);
* This string may contain a %x and should be printed with ascq as arg.
*/
const char *
-scsi_extd_sense_format(unsigned char asc, unsigned char ascq) {
+scsi_extd_sense_format(unsigned char asc, unsigned char ascq,
+ const char **fmt) {
#ifdef CONFIG_SCSI_CONSTANTS
int i;
unsigned short code = ((asc 8) | ascq);
@@ -1361,7 +1363,8 @@ scsi_extd_sense_format(unsigned char asc, unsigned char
ascq) {
if (additional2[i].code1 == asc
ascq = additional2[i].code2_min
ascq = additional2[i].code2_max)
- return additional2[i].fmt;
+ *fmt = additional2[i].fmt;
+ return additional2[i].str;
}
#endif
return NULL;
@@ -1369,49 +1372,47 @@ scsi_extd_sense_format(unsigned char asc, unsigned char
ascq) {
EXPORT_SYMBOL(scsi_extd_sense_format);
void
-scsi_show_extd_sense(unsigned char asc, unsigned char ascq)
+scsi_show_extd_sense(struct scsi_device *sdev, const char *name,
+unsigned char asc, unsigned char ascq)
{
-const char *extd_sense_fmt = scsi_extd_sense_format(asc, ascq);
-
- if (extd_sense_fmt) {
- if (strstr(extd_sense_fmt, %x)) {
- printk(Add. Sense: );
- printk(extd_sense_fmt, ascq);
- } else
- printk(Add. Sense: %s, extd_sense_fmt);
+ const char *extd_sense_fmt = NULL;
+ const char *extd_sense_str = scsi_extd_sense_format(asc, ascq,
+ extd_sense_str);
+
+ if (extd_sense_str) {
+ sdev_prefix_printk(KERN_INFO, sdev, name,
+ Add. Sense: %s (%s%x),
+