[SCSI] use {sdev,scmd,starget,shost}_printk in generic code

rejections fixed and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Jeff Garzik 2005-10-24 18:04:06 -04:00 коммит произвёл James Bottomley
Родитель 01d7b3b8d0
Коммит 3bf743e7c8
7 изменённых файлов: 33 добавлений и 39 удалений

Просмотреть файл

@ -889,8 +889,9 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
if (SCSI_SENSE_VALID(cmd)) if (SCSI_SENSE_VALID(cmd))
cmd->result |= (DRIVER_SENSE << 24); cmd->result |= (DRIVER_SENSE << 24);
SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion " SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev,
"for device %d %x\n", sdev->id, cmd->result)); "Notifying upper driver of completion "
"(result %x)\n", cmd->result));
/* /*
* We can get here with use_sg=0, causing a panic in the upper level * We can get here with use_sg=0, causing a panic in the upper level

Просмотреть файл

@ -1008,8 +1008,7 @@ static void timer_intr_handler(unsigned long indx)
static int scsi_debug_slave_alloc(struct scsi_device * sdp) static int scsi_debug_slave_alloc(struct scsi_device * sdp)
{ {
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n");
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
return 0; return 0;
} }
@ -1018,8 +1017,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp)
struct sdebug_dev_info * devip; struct sdebug_dev_info * devip;
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n", sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n");
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN)
sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN;
devip = devInfoReg(sdp); devip = devInfoReg(sdp);
@ -1036,8 +1034,7 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp)
(struct sdebug_dev_info *)sdp->hostdata; (struct sdebug_dev_info *)sdp->hostdata;
if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n", sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n");
sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
if (devip) { if (devip) {
/* make this slot avaliable for re-use */ /* make this slot avaliable for re-use */
devip->used = 0; devip->used = 0;
@ -1326,9 +1323,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
if (scsi_result) { if (scsi_result) {
struct scsi_device * sdp = cmnd->device; struct scsi_device * sdp = cmnd->device;
printk(KERN_INFO "scsi_debug: <%u %u %u %u> " sdev_printk(KERN_INFO, sdp,
"non-zero result=0x%x\n", sdp->host->host_no, "non-zero result=0x%x\n",
sdp->channel, sdp->id, sdp->lun, scsi_result); scsi_result);
} }
} }
if (cmnd && devip) { if (cmnd && devip) {

Просмотреть файл

@ -673,10 +673,9 @@ static int scsi_eh_get_sense(struct list_head *work_q,
SCSI_SENSE_VALID(scmd)) SCSI_SENSE_VALID(scmd))
continue; continue;
SCSI_LOG_ERROR_RECOVERY(2, printk("%s: requesting sense" SCSI_LOG_ERROR_RECOVERY(2, scmd_printk(KERN_INFO, scmd,
" for id: %d\n", "%s: requesting sense\n",
current->comm, current->comm));
scmd->device->id));
rtn = scsi_request_sense(scmd); rtn = scsi_request_sense(scmd);
if (rtn != SUCCESS) if (rtn != SUCCESS)
continue; continue;

Просмотреть файл

@ -951,15 +951,13 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
return; return;
} }
if (!(req->flags & REQ_QUIET)) if (!(req->flags & REQ_QUIET))
sdev_printk(KERN_INFO, scmd_printk(KERN_INFO, cmd,
cmd->device,
"Device not ready.\n"); "Device not ready.\n");
scsi_end_request(cmd, 0, this_count, 1); scsi_end_request(cmd, 0, this_count, 1);
return; return;
case VOLUME_OVERFLOW: case VOLUME_OVERFLOW:
if (!(req->flags & REQ_QUIET)) { if (!(req->flags & REQ_QUIET)) {
sdev_printk(KERN_INFO, scmd_printk(KERN_INFO, cmd,
cmd->device,
"Volume overflow, CDB: "); "Volume overflow, CDB: ");
__scsi_print_command(cmd->data_cmnd); __scsi_print_command(cmd->data_cmnd);
scsi_print_sense("", cmd); scsi_print_sense("", cmd);
@ -981,9 +979,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
} }
if (result) { if (result) {
if (!(req->flags & REQ_QUIET)) { if (!(req->flags & REQ_QUIET)) {
sdev_printk(KERN_INFO, cmd->device, scmd_printk(KERN_INFO, cmd,
"SCSI error: return code = 0x%x\n", "SCSI error: return code = 0x%x\n", result);
result);
if (driver_byte(result) & DRIVER_SENSE) if (driver_byte(result) & DRIVER_SENSE)
scsi_print_sense("", cmd); scsi_print_sense("", cmd);

Просмотреть файл

@ -1189,9 +1189,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
num_luns = max_scsi_report_luns; num_luns = max_scsi_report_luns;
} }
SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUN scan of" SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
" host %d channel %d id %d\n", sdev->host->host_no, "scsi scan: REPORT LUN scan\n"));
sdev->channel, sdev->id));
/* /*
* Scan the luns in lun_data. The entry at offset 0 is really * 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,
/* /*
* Got some results, but now none, abort. * Got some results, but now none, abort.
*/ */
printk(KERN_ERR "scsi: Unexpected response" sdev_printk(KERN_ERR, sdev,
" from %s lun %d while scanning, scan" "Unexpected response"
" aborted\n", devname, lun); " from lun %d while scanning, scan"
" aborted\n", lun);
break; break;
} }
} }
@ -1417,8 +1417,9 @@ static void scsi_scan_channel(struct Scsi_Host *shost, unsigned int channel,
int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel, int scsi_scan_host_selected(struct Scsi_Host *shost, unsigned int channel,
unsigned int id, unsigned int lun, int rescan) unsigned int id, unsigned int lun, int rescan)
{ {
SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "%s: <%u:%u:%u:%u>\n", SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost,
__FUNCTION__, shost->host_no, channel, id, lun)); "%s: <%u:%u:%u>\n",
__FUNCTION__, channel, id, lun));
if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) || if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) ||
((id != SCAN_WILD_CARD) && (id > shost->max_id)) || ((id != SCAN_WILD_CARD) && (id > shost->max_id)) ||

Просмотреть файл

@ -360,7 +360,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
} }
if (s_size != 512 && s_size != 1024 && s_size != 2048) { if (s_size != 512 && s_size != 1024 && s_size != 2048) {
sdev_printk(KERN_ERR, SCpnt->device, "bad sector size %d\n", s_size); scmd_printk(KERN_ERR, SCpnt, "bad sector size %d\n", s_size);
return 0; return 0;
} }
@ -385,7 +385,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
size += sg[i].length; size += sg[i].length;
if (size != SCpnt->request_bufflen && SCpnt->use_sg) { if (size != SCpnt->request_bufflen && SCpnt->use_sg) {
sdev_printk(KERN_ERR, SCpnt->device, scmd_printk(KERN_ERR, SCpnt,
"mismatch count %d, bytes %d\n", "mismatch count %d, bytes %d\n",
size, SCpnt->request_bufflen); size, SCpnt->request_bufflen);
if (SCpnt->request_bufflen > size) if (SCpnt->request_bufflen > size)
@ -398,7 +398,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
*/ */
if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) || if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) ||
(SCpnt->request_bufflen % s_size)) { (SCpnt->request_bufflen % s_size)) {
sdev_printk(KERN_NOTICE, SCpnt->device, "unaligned transfer\n"); scmd_printk(KERN_NOTICE, SCpnt, "unaligned transfer\n");
return 0; return 0;
} }

Просмотреть файл

@ -3887,8 +3887,7 @@ static int st_probe(struct device *dev)
if (SDp->type != TYPE_TAPE) if (SDp->type != TYPE_TAPE)
return -ENODEV; return -ENODEV;
if ((stp = st_incompatible(SDp))) { if ((stp = st_incompatible(SDp))) {
sdev_printk(KERN_INFO, SDp, sdev_printk(KERN_INFO, SDp, "Found incompatible tape\n");
"Found incompatible tape\n");
printk(KERN_INFO "st: The suggested driver is %s.\n", stp); printk(KERN_INFO "st: The suggested driver is %s.\n", stp);
return -ENODEV; return -ENODEV;
} }