]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/atari_NCR5380.c
ncr5380: Remove LIST and REMOVE macros
[karo-tx-linux.git] / drivers / scsi / atari_NCR5380.c
index 2dd65cdb0930db9a3c6a07e16839195da320b1fa..0347c87c7b537a804c2907aedaffb0692014dfad 100644 (file)
 
 /* Adapted for the sun3 by Sam Creasey. */
 
-#if (NDEBUG & NDEBUG_LISTS)
-#define LIST(x, y)                                             \
-       do {                                                    \
-               printk("LINE:%d   Adding %p to %p\n",           \
-                      __LINE__, (void*)(x), (void*)(y));       \
-               if ((x) == (y))                                 \
-                       udelay(5);                              \
-       } while (0)
-#define REMOVE(w, x, y, z)                                     \
-       do {                                                    \
-               printk("LINE:%d   Removing: %p->%p  %p->%p \n", \
-                      __LINE__, (void*)(w), (void*)(x),        \
-                      (void*)(y), (void*)(z));                 \
-               if ((x) == (y))                                 \
-                       udelay(5);                              \
-       } while (0)
-#else
-#define LIST(x,y)
-#define REMOVE(w,x,y,z)
-#endif
-
 /*
  * Design
  *
  * possible) function may be used.
  */
 
-/* Macros ease life... :-) */
-#define        SETUP_HOSTDATA(in)                              \
-    struct NCR5380_hostdata *hostdata =                        \
-       (struct NCR5380_hostdata *)(in)->hostdata
-#define        HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
-
 #define        NEXT(cmd)               ((struct scsi_cmnd *)(cmd)->host_scribble)
 #define        SET_NEXT(cmd,next)      ((cmd)->host_scribble = (void *)(next))
 #define        NEXTADDR(cmd)           ((struct scsi_cmnd **)&(cmd)->host_scribble)
 
 #define        HOSTNO          instance->host_no
-#define        H_NO(cmd)       (cmd)->device->host->host_no
 
 static int do_abort(struct Scsi_Host *);
 static void do_reset(struct Scsi_Host *);
@@ -280,7 +252,8 @@ static void __init init_tags(struct NCR5380_hostdata *hostdata)
 static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
 {
        u8 lun = cmd->device->lun;
-       SETUP_HOSTDATA(cmd->device->host);
+       struct Scsi_Host *instance = cmd->device->host;
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
 
        if (hostdata->busy[cmd->device->id] & (1 << lun))
                return 1;
@@ -290,8 +263,8 @@ static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
                return 0;
        if (hostdata->TagAlloc[scmd_id(cmd)][lun].nr_allocated >=
            hostdata->TagAlloc[scmd_id(cmd)][lun].queue_size) {
-               dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n",
-                          H_NO(cmd), cmd->device->id, lun);
+               dsprintk(NDEBUG_TAGS, instance, "target %d lun %d: no free tags\n",
+                        scmd_id(cmd), lun);
                return 1;
        }
        return 0;
@@ -306,7 +279,8 @@ static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
 static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
 {
        u8 lun = cmd->device->lun;
-       SETUP_HOSTDATA(cmd->device->host);
+       struct Scsi_Host *instance = cmd->device->host;
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
 
        /* If we or the target don't support tagged queuing, allocate the LUN for
         * an untagged command.
@@ -316,18 +290,16 @@ static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
            !cmd->device->tagged_supported) {
                cmd->tag = TAG_NONE;
                hostdata->busy[cmd->device->id] |= (1 << lun);
-               dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged "
-                          "command\n", H_NO(cmd), cmd->device->id, lun);
+               dsprintk(NDEBUG_TAGS, instance, "target %d lun %d now allocated by untagged command\n",
+                        scmd_id(cmd), lun);
        } else {
                struct tag_alloc *ta = &hostdata->TagAlloc[scmd_id(cmd)][lun];
 
                cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS);
                set_bit(cmd->tag, ta->allocated);
                ta->nr_allocated++;
-               dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d "
-                          "(now %d tags in use)\n",
-                          H_NO(cmd), cmd->tag, cmd->device->id,
-                          lun, ta->nr_allocated);
+               dsprintk(NDEBUG_TAGS, instance, "using tag %d for target %d lun %d (%d tags allocated)\n",
+                        cmd->tag, scmd_id(cmd), lun, ta->nr_allocated);
        }
 }
 
@@ -339,21 +311,22 @@ static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
 static void cmd_free_tag(struct scsi_cmnd *cmd)
 {
        u8 lun = cmd->device->lun;
-       SETUP_HOSTDATA(cmd->device->host);
+       struct Scsi_Host *instance = cmd->device->host;
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
 
        if (cmd->tag == TAG_NONE) {
                hostdata->busy[cmd->device->id] &= ~(1 << lun);
-               dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n",
-                          H_NO(cmd), cmd->device->id, lun);
+               dsprintk(NDEBUG_TAGS, instance, "target %d lun %d untagged cmd freed\n",
+                        scmd_id(cmd), lun);
        } else if (cmd->tag >= MAX_TAGS) {
-               printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n",
-                      H_NO(cmd), cmd->tag);
+               shost_printk(KERN_NOTICE, instance,
+                            "trying to free bad tag %d!\n", cmd->tag);
        } else {
                struct tag_alloc *ta = &hostdata->TagAlloc[scmd_id(cmd)][lun];
                clear_bit(cmd->tag, ta->allocated);
                ta->nr_allocated--;
-               dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n",
-                          H_NO(cmd), cmd->tag, cmd->device->id, lun);
+               dsprintk(NDEBUG_TAGS, instance, "freed tag %d for target %d lun %d\n",
+                        cmd->tag, scmd_id(cmd), lun);
        }
 }
 
@@ -656,94 +629,6 @@ static void prepare_info(struct Scsi_Host *instance)
                 "");
 }
 
-/**
- * NCR5380_print_status - dump controller info
- * @instance: controller to dump
- *
- * Print commands in the various queues, called from NCR5380_abort
- * to aid debugging.
- */
-
-static void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd)
-{
-       int i, s;
-       unsigned char *command;
-       printk("scsi%d: destination target %d, lun %llu\n",
-               H_NO(cmd), cmd->device->id, cmd->device->lun);
-       printk(KERN_CONT "        command = ");
-       command = cmd->cmnd;
-       printk(KERN_CONT "%2d (0x%02x)", command[0], command[0]);
-       for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
-               printk(KERN_CONT " %02x", command[i]);
-       printk("\n");
-}
-
-static void __maybe_unused NCR5380_print_status(struct Scsi_Host *instance)
-{
-       struct NCR5380_hostdata *hostdata;
-       struct scsi_cmnd *ptr;
-
-       NCR5380_dprint(NDEBUG_ANY, instance);
-       NCR5380_dprint_phase(NDEBUG_ANY, instance);
-
-       hostdata = (struct NCR5380_hostdata *)instance->hostdata;
-
-       if (!hostdata->connected)
-               printk("scsi%d: no currently connected command\n", HOSTNO);
-       else
-               lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected);
-       printk("scsi%d: issue_queue\n", HOSTNO);
-       for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
-               lprint_Scsi_Cmnd(ptr);
-
-       printk("scsi%d: disconnected_queue\n", HOSTNO);
-       for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
-            ptr = NEXT(ptr))
-               lprint_Scsi_Cmnd(ptr);
-       printk("\n");
-}
-
-static void show_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m)
-{
-       int i, s;
-       unsigned char *command;
-       seq_printf(m, "scsi%d: destination target %d, lun %llu\n",
-               H_NO(cmd), cmd->device->id, cmd->device->lun);
-       seq_puts(m, "        command = ");
-       command = cmd->cmnd;
-       seq_printf(m, "%2d (0x%02x)", command[0], command[0]);
-       for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
-               seq_printf(m, " %02x", command[i]);
-       seq_putc(m, '\n');
-}
-
-static int __maybe_unused NCR5380_show_info(struct seq_file *m,
-                                            struct Scsi_Host *instance)
-{
-       struct NCR5380_hostdata *hostdata;
-       struct scsi_cmnd *ptr;
-       unsigned long flags;
-
-       hostdata = (struct NCR5380_hostdata *)instance->hostdata;
-
-       spin_lock_irqsave(&hostdata->lock, flags);
-       if (!hostdata->connected)
-               seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
-       else
-               show_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected, m);
-       seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
-       for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
-               show_Scsi_Cmnd(ptr, m);
-
-       seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
-       for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
-            ptr = NEXT(ptr))
-               show_Scsi_Cmnd(ptr, m);
-
-       spin_unlock_irqrestore(&hostdata->lock, flags);
-       return 0;
-}
-
 /**
  * NCR5380_init - initialise an NCR5380
  * @instance: adapter to configure
@@ -760,8 +645,8 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
 
 static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
 {
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        int i;
-       SETUP_HOSTDATA(instance);
        unsigned long deadline;
 
        hostdata->host = instance;
@@ -903,8 +788,7 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
        switch (cmd->cmnd[0]) {
        case WRITE_6:
        case WRITE_10:
-               printk(KERN_NOTICE "scsi%d: WRITE attempted with NO_WRITE debugging flag set\n",
-                      H_NO(cmd));
+               shost_printk(KERN_DEBUG, instance, "WRITE attempted with NDEBUG_NO_WRITE set\n");
                cmd->result = (DID_ERROR << 16);
                cmd->scsi_done(cmd);
                return 0;
@@ -951,20 +835,18 @@ static int NCR5380_queue_command(struct Scsi_Host *instance,
         */
 
        if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
-               LIST(cmd, hostdata->issue_queue);
                SET_NEXT(cmd, hostdata->issue_queue);
                hostdata->issue_queue = cmd;
        } else {
                for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
                     NEXT(tmp); tmp = NEXT(tmp))
                        ;
-               LIST(cmd, tmp);
                SET_NEXT(tmp, cmd);
        }
        spin_unlock_irqrestore(&hostdata->lock, flags);
 
-       dprintk(NDEBUG_QUEUES, "scsi%d: command added to %s of queue\n", H_NO(cmd),
-                 (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
+       dsprintk(NDEBUG_QUEUES, instance, "command %p added to %s of queue\n",
+                cmd, (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
 
        /* Kick off command processing */
        queue_work(hostdata->work_q, &hostdata->main_task);
@@ -1031,10 +913,8 @@ static void NCR5380_main(struct work_struct *work)
                             prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp)) {
                                u8 lun = tmp->device->lun;
 
-                               dprintk(NDEBUG_LISTS,
-                                       "MAIN tmp=%p target=%d busy=%d lun=%d\n",
-                                       tmp, scmd_id(tmp), hostdata->busy[scmd_id(tmp)],
-                                       lun);
+                               dsprintk(NDEBUG_QUEUES, instance, "main: tmp=%p target=%d busy=%d lun=%d\n",
+                                        tmp, scmd_id(tmp), hostdata->busy[scmd_id(tmp)], lun);
                                /*  When we find one, remove it from the issue queue. */
                                if (
 #ifdef SUPPORT_TAGS
@@ -1044,13 +924,15 @@ static void NCR5380_main(struct work_struct *work)
 #endif
                                    ) {
                                        if (prev) {
-                                               REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
                                                SET_NEXT(prev, NEXT(tmp));
                                        } else {
-                                               REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
                                                hostdata->issue_queue = NEXT(tmp);
                                        }
                                        SET_NEXT(tmp, NULL);
+                                       dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES,
+                                                instance, "main: removed %p from issue queue %p\n",
+                                                tmp, prev);
+
                                        hostdata->retain_dma_intr++;
 
                                        /*
@@ -1059,9 +941,6 @@ static void NCR5380_main(struct work_struct *work)
                                         * On failure, we must add the command back to the
                                         *   issue queue so we can keep trying.
                                         */
-                                       dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d "
-                                                   "lun %d removed from issue_queue\n",
-                                                   HOSTNO, tmp->device->id, lun);
                                        /*
                                         * REQUEST SENSE commands are issued without tagged
                                         * queueing, even on SCSI-II devices because the
@@ -1081,16 +960,16 @@ static void NCR5380_main(struct work_struct *work)
                                                maybe_release_dma_irq(instance);
                                        } else {
                                                /* Need to retry */
-                                               LIST(tmp, hostdata->issue_queue);
                                                SET_NEXT(tmp, hostdata->issue_queue);
                                                hostdata->issue_queue = tmp;
+                                               dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES,
+                                                        instance, "main: select() failed, %p returned to issue queue\n",
+                                                        tmp);
 #ifdef SUPPORT_TAGS
                                                cmd_free_tag(tmp);
 #endif
                                                hostdata->retain_dma_intr--;
                                                done = 0;
-                                               dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, "
-                                                           "returned to issue_queue\n", HOSTNO);
                                        }
                                        if (hostdata->connected)
                                                break;
@@ -1127,7 +1006,7 @@ static void NCR5380_main(struct work_struct *work)
 
 static void NCR5380_dma_complete(struct Scsi_Host *instance)
 {
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        int transferred;
        unsigned char **data;
        volatile int *count;
@@ -1337,7 +1216,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
 
 static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
 {
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        unsigned char tmp[3], phase;
        unsigned char *data;
        int len;
@@ -1831,7 +1710,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
                                unsigned char *phase, int *count,
                                unsigned char **data)
 {
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        register int c = *count;
        register unsigned char p = *phase;
 
@@ -1939,7 +1818,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
 
 static void NCR5380_information_transfer(struct Scsi_Host *instance)
 {
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        unsigned char msgout = NOP;
        int sink = 0;
        int len;
@@ -2112,8 +1991,9 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
                                case COMMAND_COMPLETE:
                                        /* Accept message by clearing ACK */
                                        NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-                                       dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %llu "
-                                                 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun);
+                                       dsprintk(NDEBUG_QUEUES, instance,
+                                                "COMMAND COMPLETE %p target %d lun %llu\n",
+                                                cmd, scmd_id(cmd), cmd->device->lun);
 
                                        hostdata->connected = NULL;
 #ifdef SUPPORT_TAGS
@@ -2162,13 +2042,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
                                            (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
                                                scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);
 
-                                               dprintk(NDEBUG_AUTOSENSE, "scsi%d: performing request sense\n", HOSTNO);
-
-                                               LIST(cmd,hostdata->issue_queue);
                                                SET_NEXT(cmd, hostdata->issue_queue);
                                                hostdata->issue_queue = (struct scsi_cmnd *) cmd;
-                                               dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of "
-                                                         "issue queue\n", H_NO(cmd));
+                                               dsprintk(NDEBUG_AUTOSENSE | NDEBUG_QUEUES,
+                                                        instance, "REQUEST SENSE cmd %p added to head of issue queue\n",
+                                                        cmd);
                                        } else {
                                                cmd->scsi_done(cmd);
                                        }
@@ -2214,14 +2092,13 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
                                case DISCONNECT:
                                        /* Accept message by clearing ACK */
                                        NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
-                                       LIST(cmd,hostdata->disconnected_queue);
                                        SET_NEXT(cmd, hostdata->disconnected_queue);
                                        hostdata->connected = NULL;
                                        hostdata->disconnected_queue = cmd;
-                                       dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %llu was "
-                                                 "moved from connected to the "
-                                                 "disconnected_queue\n", HOSTNO,
-                                                 cmd->device->id, cmd->device->lun);
+                                       dsprintk(NDEBUG_INFORMATION | NDEBUG_QUEUES,
+                                                instance, "connected command %p for target %d lun %llu moved to disconnected queue\n",
+                                                cmd, scmd_id(cmd), cmd->device->lun);
+
                                        /*
                                         * Restore phase bits to 0 so an interrupted selection,
                                         * arbitration can resume.
@@ -2402,7 +2279,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
 
 static void NCR5380_reselect(struct Scsi_Host *instance)
 {
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        unsigned char target_mask;
        unsigned char lun;
 #ifdef SUPPORT_TAGS
@@ -2510,10 +2387,8 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
 #endif
                    ) {
                        if (prev) {
-                               REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
                                SET_NEXT(prev, NEXT(tmp));
                        } else {
-                               REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
                                hostdata->disconnected_queue = NEXT(tmp);
                        }
                        SET_NEXT(tmp, NULL);
@@ -2521,7 +2396,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
                }
        }
 
-       if (!tmp) {
+       if (tmp) {
+               dsprintk(NDEBUG_RESELECTION | NDEBUG_QUEUES, instance,
+                        "reselect: removed %p from disconnected queue\n", tmp);
+       } else {
+
 #ifdef SUPPORT_TAGS
                shost_printk(KERN_ERR, instance, "target bitmask 0x%02x lun %d tag %d not in disconnected queue.\n",
                             target_mask, lun, tag);
@@ -2609,7 +2488,7 @@ static
 int NCR5380_abort(struct scsi_cmnd *cmd)
 {
        struct Scsi_Host *instance = cmd->device->host;
-       SETUP_HOSTDATA(instance);
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
        struct scsi_cmnd *tmp, **prev;
        unsigned long flags;
 
@@ -2617,7 +2496,8 @@ int NCR5380_abort(struct scsi_cmnd *cmd)
 
        spin_lock_irqsave(&hostdata->lock, flags);
 
-       NCR5380_print_status(instance);
+       NCR5380_dprint(NDEBUG_ANY, instance);
+       NCR5380_dprint_phase(NDEBUG_ANY, instance);
 
        dprintk(NDEBUG_ABORT, "scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO,
                    NCR5380_read(BUS_AND_STATUS_REG),
@@ -2678,7 +2558,6 @@ int NCR5380_abort(struct scsi_cmnd *cmd)
             tmp = (struct scsi_cmnd *)hostdata->issue_queue;
             tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
                if (cmd == tmp) {
-                       REMOVE(5, *prev, tmp, NEXT(tmp));
                        (*prev) = NEXT(tmp);
                        SET_NEXT(tmp, NULL);
                        tmp->result = DID_ABORT << 16;
@@ -2752,7 +2631,6 @@ int NCR5380_abort(struct scsi_cmnd *cmd)
                             tmp = (struct scsi_cmnd *)hostdata->disconnected_queue;
                             tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
                                if (cmd == tmp) {
-                                       REMOVE(5, *prev, tmp, NEXT(tmp));
                                        *prev = NEXT(tmp);
                                        SET_NEXT(tmp, NULL);
                                        tmp->result = DID_ABORT << 16;
@@ -2815,8 +2693,9 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
 
 #if (NDEBUG & NDEBUG_ANY)
        scmd_printk(KERN_INFO, cmd, "performing bus reset\n");
-       NCR5380_print_status(instance);
 #endif
+       NCR5380_dprint(NDEBUG_ANY, instance);
+       NCR5380_dprint_phase(NDEBUG_ANY, instance);
 
        do_reset(instance);
 
@@ -2832,11 +2711,11 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
         */
 
        if (hostdata->issue_queue)
-               dprintk(NDEBUG_ABORT, "scsi%d: reset aborted issued command(s)\n", H_NO(cmd));
+               dsprintk(NDEBUG_ABORT, instance, "reset aborted issued command(s)\n");
        if (hostdata->connected)
-               dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd));
+               dsprintk(NDEBUG_ABORT, instance, "reset aborted a connected command\n");
        if (hostdata->disconnected_queue)
-               dprintk(NDEBUG_ABORT, "scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd));
+               dsprintk(NDEBUG_ABORT, instance, "reset aborted disconnected command(s)\n");
 
        hostdata->issue_queue = NULL;
        hostdata->connected = NULL;