diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-24 18:04:06 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-10-28 21:52:11 -0400 |
commit | 3bf743e7c891d8be8295650b7a6a9b5af083b096 (patch) | |
tree | cb44772c2ca37f696300ca197b89e247f83c94d7 /drivers/scsi | |
parent | 01d7b3b8d09ef78e2c835c03d97ea1d91c26e245 (diff) |
[SCSI] use {sdev,scmd,starget,shost}_printk in generic code
rejections fixed and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi.c | 5 | ||||
-rw-r--r-- | drivers/scsi/scsi_debug.c | 15 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 7 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 15 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 17 | ||||
-rw-r--r-- | drivers/scsi/sr.c | 10 | ||||
-rw-r--r-- | drivers/scsi/st.c | 3 |
7 files changed, 33 insertions, 39 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 071d109b4b2a..0be60bba58d3 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -889,8 +889,9 @@ void scsi_finish_command(struct scsi_cmnd *cmd) | |||
889 | if (SCSI_SENSE_VALID(cmd)) | 889 | if (SCSI_SENSE_VALID(cmd)) |
890 | cmd->result |= (DRIVER_SENSE << 24); | 890 | cmd->result |= (DRIVER_SENSE << 24); |
891 | 891 | ||
892 | SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion " | 892 | SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev, |
893 | "for device %d %x\n", sdev->id, cmd->result)); | 893 | "Notifying upper driver of completion " |
894 | "(result %x)\n", cmd->result)); | ||
894 | 895 | ||
895 | /* | 896 | /* |
896 | * We can get here with use_sg=0, causing a panic in the upper level | 897 | * We can get here with use_sg=0, causing a panic in the upper level |
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 322b5a41a36f..add190e22c0f 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -1008,8 +1008,7 @@ static void timer_intr_handler(unsigned long indx) | |||
1008 | static int scsi_debug_slave_alloc(struct scsi_device * sdp) | 1008 | static int scsi_debug_slave_alloc(struct scsi_device * sdp) |
1009 | { | 1009 | { |
1010 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) | 1010 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) |
1011 | printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", | 1011 | sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n"); |
1012 | sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); | ||
1013 | return 0; | 1012 | return 0; |
1014 | } | 1013 | } |
1015 | 1014 | ||
@@ -1018,8 +1017,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp) | |||
1018 | struct sdebug_dev_info * devip; | 1017 | struct sdebug_dev_info * devip; |
1019 | 1018 | ||
1020 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) | 1019 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) |
1021 | printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n", | 1020 | sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n"); |
1022 | sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); | ||
1023 | if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) | 1021 | if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) |
1024 | sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; | 1022 | sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; |
1025 | devip = devInfoReg(sdp); | 1023 | devip = devInfoReg(sdp); |
@@ -1036,8 +1034,7 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp) | |||
1036 | (struct sdebug_dev_info *)sdp->hostdata; | 1034 | (struct sdebug_dev_info *)sdp->hostdata; |
1037 | 1035 | ||
1038 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) | 1036 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) |
1039 | printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n", | 1037 | sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n"); |
1040 | sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); | ||
1041 | if (devip) { | 1038 | if (devip) { |
1042 | /* make this slot avaliable for re-use */ | 1039 | /* make this slot avaliable for re-use */ |
1043 | devip->used = 0; | 1040 | devip->used = 0; |
@@ -1326,9 +1323,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd, | |||
1326 | if (scsi_result) { | 1323 | if (scsi_result) { |
1327 | struct scsi_device * sdp = cmnd->device; | 1324 | struct scsi_device * sdp = cmnd->device; |
1328 | 1325 | ||
1329 | printk(KERN_INFO "scsi_debug: <%u %u %u %u> " | 1326 | sdev_printk(KERN_INFO, sdp, |
1330 | "non-zero result=0x%x\n", sdp->host->host_no, | 1327 | "non-zero result=0x%x\n", |
1331 | sdp->channel, sdp->id, sdp->lun, scsi_result); | 1328 | scsi_result); |
1332 | } | 1329 | } |
1333 | } | 1330 | } |
1334 | if (cmnd && devip) { | 1331 | if (cmnd && devip) { |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index dd6a9f61bdf1..f4da56a79ff6 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -673,10 +673,9 @@ static int scsi_eh_get_sense(struct list_head *work_q, | |||
673 | SCSI_SENSE_VALID(scmd)) | 673 | SCSI_SENSE_VALID(scmd)) |
674 | continue; | 674 | continue; |
675 | 675 | ||
676 | SCSI_LOG_ERROR_RECOVERY(2, printk("%s: requesting sense" | 676 | SCSI_LOG_ERROR_RECOVERY(2, scmd_printk(KERN_INFO, scmd, |
677 | " for id: %d\n", | 677 | "%s: requesting sense\n", |
678 | current->comm, | 678 | current->comm)); |
679 | scmd->device->id)); | ||
680 | rtn = scsi_request_sense(scmd); | 679 | rtn = scsi_request_sense(scmd); |
681 | if (rtn != SUCCESS) | 680 | if (rtn != SUCCESS) |
682 | continue; | 681 | continue; |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 19ac888001e6..e40c8b66da40 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -951,16 +951,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
951 | return; | 951 | return; |
952 | } | 952 | } |
953 | if (!(req->flags & REQ_QUIET)) | 953 | if (!(req->flags & REQ_QUIET)) |
954 | sdev_printk(KERN_INFO, | 954 | scmd_printk(KERN_INFO, cmd, |
955 | cmd->device, | 955 | "Device not ready.\n"); |
956 | "Device not ready.\n"); | ||
957 | scsi_end_request(cmd, 0, this_count, 1); | 956 | scsi_end_request(cmd, 0, this_count, 1); |
958 | return; | 957 | return; |
959 | case VOLUME_OVERFLOW: | 958 | case VOLUME_OVERFLOW: |
960 | if (!(req->flags & REQ_QUIET)) { | 959 | if (!(req->flags & REQ_QUIET)) { |
961 | sdev_printk(KERN_INFO, | 960 | scmd_printk(KERN_INFO, cmd, |
962 | cmd->device, | 961 | "Volume overflow, CDB: "); |
963 | "Volume overflow, CDB: "); | ||
964 | __scsi_print_command(cmd->data_cmnd); | 962 | __scsi_print_command(cmd->data_cmnd); |
965 | scsi_print_sense("", cmd); | 963 | scsi_print_sense("", cmd); |
966 | } | 964 | } |
@@ -981,9 +979,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
981 | } | 979 | } |
982 | if (result) { | 980 | if (result) { |
983 | if (!(req->flags & REQ_QUIET)) { | 981 | if (!(req->flags & REQ_QUIET)) { |
984 | sdev_printk(KERN_INFO, cmd->device, | 982 | scmd_printk(KERN_INFO, cmd, |
985 | "SCSI error: return code = 0x%x\n", | 983 | "SCSI error: return code = 0x%x\n", result); |
986 | result); | ||
987 | 984 | ||
988 | if (driver_byte(result) & DRIVER_SENSE) | 985 | if (driver_byte(result) & DRIVER_SENSE) |
989 | scsi_print_sense("", cmd); | 986 | scsi_print_sense("", cmd); |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index e8f6fee34c94..7eb3a2d40dc5 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -1189,9 +1189,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1189 | num_luns = max_scsi_report_luns; | 1189 | num_luns = max_scsi_report_luns; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUN scan of" | 1192 | SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev, |
1193 | " host %d channel %d id %d\n", sdev->host->host_no, | 1193 | "scsi scan: REPORT LUN scan\n")); |
1194 | sdev->channel, sdev->id)); | ||
1195 | 1194 | ||
1196 | /* | 1195 | /* |
1197 | * Scan the luns in lun_data. The entry at offset 0 is really | 1196 | * Scan the luns in lun_data. The entry at offset 0 is really |
@@ -1230,9 +1229,10 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1230 | /* | 1229 | /* |
1231 | * Got some results, but now none, abort. | 1230 | * Got some results, but now none, abort. |
1232 | */ | 1231 | */ |
1233 | printk(KERN_ERR "scsi: Unexpected response" | 1232 | sdev_printk(KERN_ERR, sdev, |
1234 | " from %s lun %d while scanning, scan" | 1233 | "Unexpected response" |
1235 | " aborted\n", devname, lun); | 1234 | " from lun %d while scanning, scan" |
1235 | " aborted\n", lun); | ||
1236 | break; | 1236 | break; |
1237 | } | 1237 | } |
1238 | } | 1238 | } |
@@ -1417,8 +1417,9 @@ static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel, | |||
1417 | int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, | 1417 | int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, |
1418 | unsigned int id, unsigned int lun, int rescan) | 1418 | unsigned int id, unsigned int lun, int rescan) |
1419 | { | 1419 | { |
1420 | SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "%s: <%u:%u:%u:%u>\n", | 1420 | SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost, |
1421 | __FUNCTION__, shost->host_no, channel, id, lun)); | 1421 | "%s: <%u:%u:%u>\n", |
1422 | __FUNCTION__, channel, id, lun)); | ||
1422 | 1423 | ||
1423 | if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || | 1424 | if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || |
1424 | ((id != SCAN_WILD_CARD) && (id > shost->max_id)) || | 1425 | ((id != SCAN_WILD_CARD) && (id > shost->max_id)) || |
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 3067e5a7b75e..d68cea753bb2 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -360,7 +360,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
360 | } | 360 | } |
361 | 361 | ||
362 | if (s_size != 512 && s_size != 1024 && s_size != 2048) { | 362 | if (s_size != 512 && s_size != 1024 && s_size != 2048) { |
363 | sdev_printk(KERN_ERR, SCpnt->device, "bad sector size %d\n", s_size); | 363 | scmd_printk(KERN_ERR, SCpnt, "bad sector size %d\n", s_size); |
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
366 | 366 | ||
@@ -385,9 +385,9 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
385 | size += sg[i].length; | 385 | size += sg[i].length; |
386 | 386 | ||
387 | if (size != SCpnt->request_bufflen && SCpnt->use_sg) { | 387 | if (size != SCpnt->request_bufflen && SCpnt->use_sg) { |
388 | sdev_printk(KERN_ERR, SCpnt->device, | 388 | scmd_printk(KERN_ERR, SCpnt, |
389 | "mismatch count %d, bytes %d\n", | 389 | "mismatch count %d, bytes %d\n", |
390 | size, SCpnt->request_bufflen); | 390 | size, SCpnt->request_bufflen); |
391 | if (SCpnt->request_bufflen > size) | 391 | if (SCpnt->request_bufflen > size) |
392 | SCpnt->request_bufflen = SCpnt->bufflen = size; | 392 | SCpnt->request_bufflen = SCpnt->bufflen = size; |
393 | } | 393 | } |
@@ -398,7 +398,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
398 | */ | 398 | */ |
399 | if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) || | 399 | if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) || |
400 | (SCpnt->request_bufflen % s_size)) { | 400 | (SCpnt->request_bufflen % s_size)) { |
401 | sdev_printk(KERN_NOTICE, SCpnt->device, "unaligned transfer\n"); | 401 | scmd_printk(KERN_NOTICE, SCpnt, "unaligned transfer\n"); |
402 | return 0; | 402 | return 0; |
403 | } | 403 | } |
404 | 404 | ||
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index dc5ffc16a252..2913f8792317 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -3887,8 +3887,7 @@ static int st_probe(struct device *dev) | |||
3887 | if (SDp->type != TYPE_TAPE) | 3887 | if (SDp->type != TYPE_TAPE) |
3888 | return -ENODEV; | 3888 | return -ENODEV; |
3889 | if ((stp = st_incompatible(SDp))) { | 3889 | if ((stp = st_incompatible(SDp))) { |
3890 | sdev_printk(KERN_INFO, SDp, | 3890 | sdev_printk(KERN_INFO, SDp, "Found incompatible tape\n"); |
3891 | "Found incompatible tape\n"); | ||
3892 | printk(KERN_INFO "st: The suggested driver is %s.\n", stp); | 3891 | printk(KERN_INFO "st: The suggested driver is %s.\n", stp); |
3893 | return -ENODEV; | 3892 | return -ENODEV; |
3894 | } | 3893 | } |