]> err.no Git - linux-2.6/commitdiff
[SCSI] use {sdev,scmd,starget,shost}_printk in generic code
authorJeff Garzik <jgarzik@pobox.com>
Mon, 24 Oct 2005 22:04:06 +0000 (18:04 -0400)
committerJames Bottomley <jejb@mulgrave.(none)>
Sat, 29 Oct 2005 01:52:11 +0000 (20:52 -0500)
rejections fixed and
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/scsi.c
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_scan.c
drivers/scsi/sr.c
drivers/scsi/st.c

index 071d109b4b2a5e8191950afb010aee075a3dedfd..0be60bba58d320d4c712426bb140606769f791fe 100644 (file)
@@ -889,8 +889,9 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
        if (SCSI_SENSE_VALID(cmd))
                cmd->result |= (DRIVER_SENSE << 24);
 
-       SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion "
-                               "for device %d %x\n", sdev->id, cmd->result));
+       SCSI_LOG_MLCOMPLETE(4, sdev_printk(KERN_INFO, sdev,
+                               "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
index 322b5a41a36ff10046021f4e289eac7ddb630568..add190e22c0fac77f4043c513c6fb3c76f56a025 100644 (file)
@@ -1008,8 +1008,7 @@ static void timer_intr_handler(unsigned long indx)
 static int scsi_debug_slave_alloc(struct scsi_device * sdp)
 {
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n",
-                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
+               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n");
        return 0;
 }
 
@@ -1018,8 +1017,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp)
        struct sdebug_dev_info * devip;
 
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n",
-                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
+               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n");
        if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN)
                sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN;
        devip = devInfoReg(sdp);
@@ -1036,8 +1034,7 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp)
                                (struct sdebug_dev_info *)sdp->hostdata;
 
        if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
-               printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n",
-                      sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
+               sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n");
        if (devip) {
                /* make this slot avaliable for re-use */
                devip->used = 0;
@@ -1326,9 +1323,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd,
                if (scsi_result) {
                        struct scsi_device * sdp = cmnd->device;
 
-                       printk(KERN_INFO "scsi_debug:    <%u %u %u %u> "
-                              "non-zero result=0x%x\n", sdp->host->host_no,
-                              sdp->channel, sdp->id, sdp->lun, scsi_result);
+                       sdev_printk(KERN_INFO, sdp,
+                               "non-zero result=0x%x\n",
+                               scsi_result);
                }
        }
        if (cmnd && devip) {
index dd6a9f61bdf1bc42a829587d57508ef0afe7b9c3..f4da56a79ff666d5d9956a93c4858f92d14ee63e 100644 (file)
@@ -673,10 +673,9 @@ static int scsi_eh_get_sense(struct list_head *work_q,
                    SCSI_SENSE_VALID(scmd))
                        continue;
 
-               SCSI_LOG_ERROR_RECOVERY(2, printk("%s: requesting sense"
-                                                 " for id: %d\n",
-                                                 current->comm,
-                                                 scmd->device->id));
+               SCSI_LOG_ERROR_RECOVERY(2, scmd_printk(KERN_INFO, scmd,
+                                                 "%s: requesting sense\n",
+                                                 current->comm));
                rtn = scsi_request_sense(scmd);
                if (rtn != SUCCESS)
                        continue;
index 19ac888001e6d14c5246878b386f6d0479be591c..e40c8b66da40fe80ab6a1167ed29b1e9e62fa3d9 100644 (file)
@@ -951,16 +951,14 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
                                return;
                        }
                        if (!(req->flags & REQ_QUIET))
-                               sdev_printk(KERN_INFO,
-                                           cmd->device,
-                                           "Device not ready.\n");
+                               scmd_printk(KERN_INFO, cmd,
+                                          "Device not ready.\n");
                        scsi_end_request(cmd, 0, this_count, 1);
                        return;
                case VOLUME_OVERFLOW:
                        if (!(req->flags & REQ_QUIET)) {
-                               sdev_printk(KERN_INFO,
-                                           cmd->device,
-                                           "Volume overflow, CDB: ");
+                               scmd_printk(KERN_INFO, cmd,
+                                          "Volume overflow, CDB: ");
                                __scsi_print_command(cmd->data_cmnd);
                                scsi_print_sense("", cmd);
                        }
@@ -981,9 +979,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes,
        }
        if (result) {
                if (!(req->flags & REQ_QUIET)) {
-                       sdev_printk(KERN_INFO, cmd->device,
-                                   "SCSI error: return code = 0x%x\n",
-                                   result);
+                       scmd_printk(KERN_INFO, cmd,
+                                  "SCSI error: return code = 0x%x\n", result);
 
                        if (driver_byte(result) & DRIVER_SENSE)
                                scsi_print_sense("", cmd);
index e8f6fee34c941c3c9c0f8452f63369efbce0b2b5..7eb3a2d40dc5258d5f552cdf878ecae351668785 100644 (file)
@@ -1189,9 +1189,8 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
                num_luns = max_scsi_report_luns;
        }
 
-       SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "scsi scan: REPORT LUN scan of"
-                       " host %d channel %d id %d\n", sdev->host->host_no,
-                       sdev->channel, sdev->id));
+       SCSI_LOG_SCAN_BUS(3, sdev_printk (KERN_INFO, sdev,
+               "scsi scan: REPORT LUN scan\n"));
 
        /*
         * 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.
                                 */
-                               printk(KERN_ERR "scsi: Unexpected response"
-                                      " from %s lun %d while scanning, scan"
-                                      " aborted\n", devname, lun);
+                               sdev_printk(KERN_ERR, sdev,
+                                       "Unexpected response"
+                                       " from lun %d while scanning, scan"
+                                       " aborted\n", lun);
                                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,
                            unsigned int id, unsigned int lun, int rescan)
 {
-       SCSI_LOG_SCAN_BUS(3, printk (KERN_INFO "%s: <%u:%u:%u:%u>\n",
-               __FUNCTION__, shost->host_no, channel, id, lun));
+       SCSI_LOG_SCAN_BUS(3, shost_printk (KERN_INFO, shost,
+               "%s: <%u:%u:%u>\n",
+               __FUNCTION__, channel, id, lun));
 
        if (((channel != SCAN_WILD_CARD) && (channel > shost->max_channel)) ||
            ((id != SCAN_WILD_CARD) && (id > shost->max_id)) ||
index 3067e5a7b75ebba3c040c60b321ac3b3723dc42c..d68cea753bb2222629db977d5ebf37614dc9c093 100644 (file)
@@ -360,7 +360,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
        }
 
        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;
        }
 
@@ -385,9 +385,9 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
                        size += sg[i].length;
 
                if (size != SCpnt->request_bufflen && SCpnt->use_sg) {
-                       sdev_printk(KERN_ERR, SCpnt->device,
-                                   "mismatch count %d, bytes %d\n",
-                                   size, SCpnt->request_bufflen);
+                       scmd_printk(KERN_ERR, SCpnt,
+                               "mismatch count %d, bytes %d\n",
+                               size, SCpnt->request_bufflen);
                        if (SCpnt->request_bufflen > size)
                                SCpnt->request_bufflen = SCpnt->bufflen = size;
                }
@@ -398,7 +398,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
         */
        if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) ||
            (SCpnt->request_bufflen % s_size)) {
-               sdev_printk(KERN_NOTICE, SCpnt->device, "unaligned transfer\n");
+               scmd_printk(KERN_NOTICE, SCpnt, "unaligned transfer\n");
                return 0;
        }
 
index dc5ffc16a252b79db7b57eb48647fa5ac46a8361..2913f879231784158eafbfa0a2663e00d6c93e22 100644 (file)
@@ -3887,8 +3887,7 @@ static int st_probe(struct device *dev)
        if (SDp->type != TYPE_TAPE)
                return -ENODEV;
        if ((stp = st_incompatible(SDp))) {
-         sdev_printk(KERN_INFO, SDp,
-                     "Found incompatible tape\n");
+               sdev_printk(KERN_INFO, SDp, "Found incompatible tape\n");
                printk(KERN_INFO "st: The suggested driver is %s.\n", stp);
                return -ENODEV;
        }