diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 72ed972..6bd8e83 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -75,7 +75,7 @@
 #define ADVANSYS_STATS
 
 /* Enable driver tracing. */
-/* #define ADVANSYS_DEBUG */
+#undef ADVANSYS_DEBUG
 
 /*
  * Portable Data Types
@@ -2277,13 +2277,8 @@
 
 #ifndef ADVANSYS_DEBUG
 
-#define ASC_DBG(lvl, s)
-#define ASC_DBG1(lvl, s, a1)
-#define ASC_DBG2(lvl, s, a1, a2)
-#define ASC_DBG3(lvl, s, a1, a2, a3)
-#define ASC_DBG4(lvl, s, a1, a2, a3, a4)
+#define ASC_DBG(lvl, s...)
 #define ASC_DBG_PRT_SCSI_HOST(lvl, s)
-#define ASC_DBG_PRT_SCSI_CMND(lvl, s)
 #define ASC_DBG_PRT_ASC_SCSI_Q(lvl, scsiqp)
 #define ASC_DBG_PRT_ADV_SCSI_REQ_Q(lvl, scsiqp)
 #define ASC_DBG_PRT_ASC_QDONE_INFO(lvl, qdone)
@@ -2302,40 +2297,11 @@
  * 2-N: Verbose Tracing
  */
 
-#define ASC_DBG(lvl, s) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            printk(s); \
-        } \
-    }
-
-#define ASC_DBG1(lvl, s, a1) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            printk((s), (a1)); \
-        } \
-    }
-
-#define ASC_DBG2(lvl, s, a1, a2) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            printk((s), (a1), (a2)); \
-        } \
-    }
-
-#define ASC_DBG3(lvl, s, a1, a2, a3) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            printk((s), (a1), (a2), (a3)); \
-        } \
-    }
-
-#define ASC_DBG4(lvl, s, a1, a2, a3, a4) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            printk((s), (a1), (a2), (a3), (a4)); \
-        } \
-    }
+#define ASC_DBG(lvl, format, arg...) {					\
+	if (asc_dbglvl >= (lvl))					\
+		printk(KERN_DEBUG "%s: %s: " format, DRV_NAME,		\
+			__FUNCTION__ , ## arg);				\
+}
 
 #define ASC_DBG_PRT_SCSI_HOST(lvl, s) \
     { \
@@ -2344,13 +2310,6 @@
         } \
     }
 
-#define ASC_DBG_PRT_SCSI_CMND(lvl, s) \
-    { \
-        if (asc_dbglvl >= (lvl)) { \
-            asc_prt_scsi_cmnd(s); \
-        } \
-    }
-
 #define ASC_DBG_PRT_ASC_SCSI_Q(lvl, scsiqp) \
     { \
         if (asc_dbglvl >= (lvl)) { \
@@ -2519,64 +2478,6 @@
 static int asc_dbglvl = 3;
 
 /*
- * asc_prt_scsi_host()
- */
-static void asc_prt_scsi_host(struct Scsi_Host *s)
-{
-	struct asc_board *boardp = shost_priv(s);
-
-	printk("Scsi_Host at addr 0x%lx\n", (ulong)s);
-	printk(" host_busy %u, host_no %d, last_reset %d,\n",
-	       s->host_busy, s->host_no, (unsigned)s->last_reset);
-
-	printk(" base 0x%lx, io_port 0x%lx, irq 0x%x,\n",
-	       (ulong)s->base, (ulong)s->io_port, boardp->irq);
-
-	printk(" dma_channel %d, this_id %d, can_queue %d,\n",
-	       s->dma_channel, s->this_id, s->can_queue);
-
-	printk(" cmd_per_lun %d, sg_tablesize %d, unchecked_isa_dma %d\n",
-	       s->cmd_per_lun, s->sg_tablesize, s->unchecked_isa_dma);
-
-	if (ASC_NARROW_BOARD(boardp)) {
-		asc_prt_asc_dvc_var(boardp->dvc_var.asc_dvc_var);
-		asc_prt_asc_dvc_cfg(boardp->dvc_cfg.asc_dvc_cfg);
-	} else {
-		asc_prt_adv_dvc_var(boardp->dvc_var.adv_dvc_var);
-		asc_prt_adv_dvc_cfg(boardp->dvc_cfg.adv_dvc_cfg);
-	}
-}
-
-/*
- * asc_prt_scsi_cmnd()
- */
-static void asc_prt_scsi_cmnd(struct scsi_cmnd *s)
-{
-	printk("struct scsi_cmnd at addr 0x%lx\n", (ulong)s);
-
-	printk(" host 0x%lx, device 0x%lx, target %u, lun %u, channel %u,\n",
-	       (ulong)s->device->host, (ulong)s->device, s->device->id,
-	       s->device->lun, s->device->channel);
-
-	asc_prt_hex(" CDB", s->cmnd, s->cmd_len);
-
-	printk("sc_data_direction %u, resid %d\n",
-	       s->sc_data_direction, s->resid);
-
-	printk(" use_sg %u, sglist_len %u\n", s->use_sg, s->sglist_len);
-
-	printk(" serial_number 0x%x, retries %d, allowed %d\n",
-	       (unsigned)s->serial_number, s->retries, s->allowed);
-
-	printk(" timeout_per_command %d\n", s->timeout_per_command);
-
-	printk(" scsi_done 0x%p, done 0x%p, host_scribble 0x%p, result 0x%x\n",
-		s->scsi_done, s->done, s->host_scribble, s->result);
-
-	printk(" tag %u, pid %u\n", (unsigned)s->tag, (unsigned)s->pid);
-}
-
-/*
  * asc_prt_asc_dvc_var()
  */
 static void asc_prt_asc_dvc_var(ASC_DVC_VAR *h)
@@ -2627,65 +2528,11 @@
 		"chip_version %d,\n", h->chip_scsi_id, h->isa_dma_speed,
 		h->isa_dma_channel, h->chip_version);
 
-	printk(" pci_device_id %d, mcode_date 0x%x, mcode_version %d, "
-		"overrun_buf 0x%p\n", to_pci_dev(h->dev)->device,
+	printk(" mcode_date 0x%x, mcode_version %d, overrun_buf 0x%p\n",
 		h->mcode_date, h->mcode_version, h->overrun_buf);
 }
 
 /*
- * asc_prt_asc_scsi_q()
- */
-static void asc_prt_asc_scsi_q(ASC_SCSI_Q *q)
-{
-	ASC_SG_HEAD *sgp;
-	int i;
-
-	printk("ASC_SCSI_Q at addr 0x%lx\n", (ulong)q);
-
-	printk
-	    (" target_ix 0x%x, target_lun %u, srb_ptr 0x%lx, tag_code 0x%x,\n",
-	     q->q2.target_ix, q->q1.target_lun, (ulong)q->q2.srb_ptr,
-	     q->q2.tag_code);
-
-	printk
-	    (" data_addr 0x%lx, data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n",
-	     (ulong)le32_to_cpu(q->q1.data_addr),
-	     (ulong)le32_to_cpu(q->q1.data_cnt),
-	     (ulong)le32_to_cpu(q->q1.sense_addr), q->q1.sense_len);
-
-	printk(" cdbptr 0x%lx, cdb_len %u, sg_head 0x%lx, sg_queue_cnt %u\n",
-	       (ulong)q->cdbptr, q->q2.cdb_len,
-	       (ulong)q->sg_head, q->q1.sg_queue_cnt);
-
-	if (q->sg_head) {
-		sgp = q->sg_head;
-		printk("ASC_SG_HEAD at addr 0x%lx\n", (ulong)sgp);
-		printk(" entry_cnt %u, queue_cnt %u\n", sgp->entry_cnt,
-		       sgp->queue_cnt);
-		for (i = 0; i < sgp->entry_cnt; i++) {
-			printk(" [%u]: addr 0x%lx, bytes %lu\n",
-			       i, (ulong)le32_to_cpu(sgp->sg_list[i].addr),
-			       (ulong)le32_to_cpu(sgp->sg_list[i].bytes));
-		}
-
-	}
-}
-
-/*
- * asc_prt_asc_qdone_info()
- */
-static void asc_prt_asc_qdone_info(ASC_QDONE_INFO *q)
-{
-	printk("ASC_QDONE_INFO at addr 0x%lx\n", (ulong)q);
-	printk(" srb_ptr 0x%lx, target_ix %u, cdb_len %u, tag_code %u,\n",
-	       (ulong)q->d2.srb_ptr, q->d2.target_ix, q->d2.cdb_len,
-	       q->d2.tag_code);
-	printk
-	    (" done_stat 0x%x, host_stat 0x%x, scsi_stat 0x%x, scsi_msg 0x%x\n",
-	     q->d3.done_stat, q->d3.host_stat, q->d3.scsi_stat, q->d3.scsi_msg);
-}
-
-/*
  * asc_prt_adv_dvc_var()
  *
  * Display an ADV_DVC_VAR structure.
@@ -2697,9 +2544,8 @@
 	printk("  iop_base 0x%lx, err_code 0x%x, ultra_able 0x%x\n",
 	       (ulong)h->iop_base, h->err_code, (unsigned)h->ultra_able);
 
-	printk("  isr_callback 0x%lx, sdtr_able 0x%x, wdtr_able 0x%x\n",
-	       (ulong)h->isr_callback, (unsigned)h->sdtr_able,
-	       (unsigned)h->wdtr_able);
+	printk("  sdtr_able 0x%x, wdtr_able 0x%x\n",
+	       (unsigned)h->sdtr_able, (unsigned)h->wdtr_able);
 
 	printk("  start_motor 0x%x, scsi_reset_wait 0x%x\n",
 	       (unsigned)h->start_motor, (unsigned)h->scsi_reset_wait);
@@ -2733,87 +2579,36 @@
 	printk("  chip_version 0x%x, mcode_date 0x%x\n",
 	       h->chip_version, h->mcode_date);
 
-	printk("  mcode_version 0x%x, pci_device_id 0x%x\n",
-	       h->mcode_version, to_pci_dev(h->dev)->device);
-
-	printk("  control_flag 0x%x\n", h->control_flag);
+	printk("  mcode_version 0x%x, control_flag 0x%x\n",
+	       h->mcode_version, h->control_flag);
 }
 
 /*
- * asc_prt_adv_scsi_req_q()
- *
- * Display an ADV_SCSI_REQ_Q structure.
+ * asc_prt_scsi_host()
  */
-static void asc_prt_adv_scsi_req_q(ADV_SCSI_REQ_Q *q)
+static void asc_prt_scsi_host(struct Scsi_Host *s)
 {
-	int sg_blk_cnt;
-	struct asc_sg_block *sg_ptr;
+	struct asc_board *boardp = shost_priv(s);
 
-	printk("ADV_SCSI_REQ_Q at addr 0x%lx\n", (ulong)q);
+	printk("Scsi_Host at addr 0x%p, device %s\n", s, boardp->dev->bus_id);
+	printk(" host_busy %u, host_no %d, last_reset %d,\n",
+	       s->host_busy, s->host_no, (unsigned)s->last_reset);
 
-	printk("  target_id %u, target_lun %u, srb_ptr 0x%lx, a_flag 0x%x\n",
-	       q->target_id, q->target_lun, (ulong)q->srb_ptr, q->a_flag);
+	printk(" base 0x%lx, io_port 0x%lx, irq %d,\n",
+	       (ulong)s->base, (ulong)s->io_port, boardp->irq);
 
-	printk("  cntl 0x%x, data_addr 0x%lx, vdata_addr 0x%lx\n",
-	       q->cntl, (ulong)le32_to_cpu(q->data_addr), (ulong)q->vdata_addr);
+	printk(" dma_channel %d, this_id %d, can_queue %d,\n",
+	       s->dma_channel, s->this_id, s->can_queue);
 
-	printk("  data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n",
-	       (ulong)le32_to_cpu(q->data_cnt),
-	       (ulong)le32_to_cpu(q->sense_addr), q->sense_len);
+	printk(" cmd_per_lun %d, sg_tablesize %d, unchecked_isa_dma %d\n",
+	       s->cmd_per_lun, s->sg_tablesize, s->unchecked_isa_dma);
 
-	printk
-	    ("  cdb_len %u, done_status 0x%x, host_status 0x%x, scsi_status 0x%x\n",
-	     q->cdb_len, q->done_status, q->host_status, q->scsi_status);
-
-	printk("  sg_working_ix 0x%x, target_cmd %u\n",
-	       q->sg_working_ix, q->target_cmd);
-
-	printk("  scsiq_rptr 0x%lx, sg_real_addr 0x%lx, sg_list_ptr 0x%lx\n",
-	       (ulong)le32_to_cpu(q->scsiq_rptr),
-	       (ulong)le32_to_cpu(q->sg_real_addr), (ulong)q->sg_list_ptr);
-
-	/* Display the request's ADV_SG_BLOCK structures. */
-	if (q->sg_list_ptr != NULL) {
-		sg_blk_cnt = 0;
-		while (1) {
-			/*
-			 * 'sg_ptr' is a physical address. Convert it to a virtual
-			 * address by indexing 'sg_blk_cnt' into the virtual address
-			 * array 'sg_list_ptr'.
-			 *
-			 * XXX - Assumes all SG physical blocks are virtually contiguous.
-			 */
-			sg_ptr =
-			    &(((ADV_SG_BLOCK *)(q->sg_list_ptr))[sg_blk_cnt]);
-			asc_prt_adv_sgblock(sg_blk_cnt, sg_ptr);
-			if (sg_ptr->sg_ptr == 0) {
-				break;
-			}
-			sg_blk_cnt++;
-		}
-	}
-}
-
-/*
- * asc_prt_adv_sgblock()
- *
- * Display an ADV_SG_BLOCK structure.
- */
-static void asc_prt_adv_sgblock(int sgblockno, ADV_SG_BLOCK *b)
-{
-	int i;
-
-	printk(" ASC_SG_BLOCK at addr 0x%lx (sgblockno %d)\n",
-	       (ulong)b, sgblockno);
-	printk("  sg_cnt %u, sg_ptr 0x%lx\n",
-	       b->sg_cnt, (ulong)le32_to_cpu(b->sg_ptr));
-	BUG_ON(b->sg_cnt > NO_OF_SG_PER_BLOCK);
-	if (b->sg_ptr != 0)
-		BUG_ON(b->sg_cnt != NO_OF_SG_PER_BLOCK);
-	for (i = 0; i < b->sg_cnt; i++) {
-		printk("  [%u]: sg_addr 0x%lx, sg_count 0x%lx\n",
-		       i, (ulong)b->sg_list[i].sg_addr,
-		       (ulong)b->sg_list[i].sg_count);
+	if (ASC_NARROW_BOARD(boardp)) {
+		asc_prt_asc_dvc_var(&boardp->dvc_var.asc_dvc_var);
+		asc_prt_asc_dvc_cfg(&boardp->dvc_cfg.asc_dvc_cfg);
+	} else {
+		asc_prt_adv_dvc_var(&boardp->dvc_var.adv_dvc_var);
+		asc_prt_adv_dvc_cfg(&boardp->dvc_cfg.adv_dvc_cfg);
 	}
 }
 
@@ -2873,6 +2668,137 @@
 		printk("\n");
 	}
 }
+
+/*
+ * asc_prt_asc_scsi_q()
+ */
+static void asc_prt_asc_scsi_q(ASC_SCSI_Q *q)
+{
+	ASC_SG_HEAD *sgp;
+	int i;
+
+	printk("ASC_SCSI_Q at addr 0x%lx\n", (ulong)q);
+
+	printk
+	    (" target_ix 0x%x, target_lun %u, srb_ptr 0x%lx, tag_code 0x%x,\n",
+	     q->q2.target_ix, q->q1.target_lun, (ulong)q->q2.srb_ptr,
+	     q->q2.tag_code);
+
+	printk
+	    (" data_addr 0x%lx, data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n",
+	     (ulong)le32_to_cpu(q->q1.data_addr),
+	     (ulong)le32_to_cpu(q->q1.data_cnt),
+	     (ulong)le32_to_cpu(q->q1.sense_addr), q->q1.sense_len);
+
+	printk(" cdbptr 0x%lx, cdb_len %u, sg_head 0x%lx, sg_queue_cnt %u\n",
+	       (ulong)q->cdbptr, q->q2.cdb_len,
+	       (ulong)q->sg_head, q->q1.sg_queue_cnt);
+
+	if (q->sg_head) {
+		sgp = q->sg_head;
+		printk("ASC_SG_HEAD at addr 0x%lx\n", (ulong)sgp);
+		printk(" entry_cnt %u, queue_cnt %u\n", sgp->entry_cnt,
+		       sgp->queue_cnt);
+		for (i = 0; i < sgp->entry_cnt; i++) {
+			printk(" [%u]: addr 0x%lx, bytes %lu\n",
+			       i, (ulong)le32_to_cpu(sgp->sg_list[i].addr),
+			       (ulong)le32_to_cpu(sgp->sg_list[i].bytes));
+		}
+
+	}
+}
+
+/*
+ * asc_prt_asc_qdone_info()
+ */
+static void asc_prt_asc_qdone_info(ASC_QDONE_INFO *q)
+{
+	printk("ASC_QDONE_INFO at addr 0x%lx\n", (ulong)q);
+	printk(" srb_ptr 0x%lx, target_ix %u, cdb_len %u, tag_code %u,\n",
+	       (ulong)q->d2.srb_ptr, q->d2.target_ix, q->d2.cdb_len,
+	       q->d2.tag_code);
+	printk
+	    (" done_stat 0x%x, host_stat 0x%x, scsi_stat 0x%x, scsi_msg 0x%x\n",
+	     q->d3.done_stat, q->d3.host_stat, q->d3.scsi_stat, q->d3.scsi_msg);
+}
+
+/*
+ * asc_prt_adv_sgblock()
+ *
+ * Display an ADV_SG_BLOCK structure.
+ */
+static void asc_prt_adv_sgblock(int sgblockno, ADV_SG_BLOCK *b)
+{
+	int i;
+
+	printk(" ASC_SG_BLOCK at addr 0x%lx (sgblockno %d)\n",
+	       (ulong)b, sgblockno);
+	printk("  sg_cnt %u, sg_ptr 0x%lx\n",
+	       b->sg_cnt, (ulong)le32_to_cpu(b->sg_ptr));
+	BUG_ON(b->sg_cnt > NO_OF_SG_PER_BLOCK);
+	if (b->sg_ptr != 0)
+		BUG_ON(b->sg_cnt != NO_OF_SG_PER_BLOCK);
+	for (i = 0; i < b->sg_cnt; i++) {
+		printk("  [%u]: sg_addr 0x%lx, sg_count 0x%lx\n",
+		       i, (ulong)b->sg_list[i].sg_addr,
+		       (ulong)b->sg_list[i].sg_count);
+	}
+}
+
+/*
+ * asc_prt_adv_scsi_req_q()
+ *
+ * Display an ADV_SCSI_REQ_Q structure.
+ */
+static void asc_prt_adv_scsi_req_q(ADV_SCSI_REQ_Q *q)
+{
+	int sg_blk_cnt;
+	struct asc_sg_block *sg_ptr;
+
+	printk("ADV_SCSI_REQ_Q at addr 0x%lx\n", (ulong)q);
+
+	printk("  target_id %u, target_lun %u, srb_ptr 0x%lx, a_flag 0x%x\n",
+	       q->target_id, q->target_lun, (ulong)q->srb_ptr, q->a_flag);
+
+	printk("  cntl 0x%x, data_addr 0x%lx, vdata_addr 0x%lx\n",
+	       q->cntl, (ulong)le32_to_cpu(q->data_addr), (ulong)q->vdata_addr);
+
+	printk("  data_cnt %lu, sense_addr 0x%lx, sense_len %u,\n",
+	       (ulong)le32_to_cpu(q->data_cnt),
+	       (ulong)le32_to_cpu(q->sense_addr), q->sense_len);
+
+	printk
+	    ("  cdb_len %u, done_status 0x%x, host_status 0x%x, scsi_status 0x%x\n",
+	     q->cdb_len, q->done_status, q->host_status, q->scsi_status);
+
+	printk("  sg_working_ix 0x%x, target_cmd %u\n",
+	       q->sg_working_ix, q->target_cmd);
+
+	printk("  scsiq_rptr 0x%lx, sg_real_addr 0x%lx, sg_list_ptr 0x%lx\n",
+	       (ulong)le32_to_cpu(q->scsiq_rptr),
+	       (ulong)le32_to_cpu(q->sg_real_addr), (ulong)q->sg_list_ptr);
+
+	/* Display the request's ADV_SG_BLOCK structures. */
+	if (q->sg_list_ptr != NULL) {
+		sg_blk_cnt = 0;
+		while (1) {
+			/*
+			 * 'sg_ptr' is a physical address. Convert it to a virtual
+			 * address by indexing 'sg_blk_cnt' into the virtual address
+			 * array 'sg_list_ptr'.
+			 *
+			 * XXX - Assumes all SG physical blocks are virtually contiguous.
+			 */
+			sg_ptr =
+			    &(((ADV_SG_BLOCK *)(q->sg_list_ptr))[sg_blk_cnt]);
+			asc_prt_adv_sgblock(sg_blk_cnt, sg_ptr);
+			if (sg_ptr->sg_ptr == 0) {
+				break;
+			}
+			sg_blk_cnt++;
+		}
+	}
+}
 #endif /* ADVANSYS_DEBUG */
 
 /*
@@ -2895,7 +2821,7 @@
 
 	if (ASC_NARROW_BOARD(boardp)) {
 		asc_dvc_varp = &boardp->dvc_var.asc_dvc_var;
-		ASC_DBG(1, "advansys_info: begin\n");
+		ASC_DBG(1, "begin\n");
 		if (asc_dvc_varp->bus_type & ASC_IS_ISA) {
 			if ((asc_dvc_varp->bus_type & ASC_IS_ISAPNP) ==
 			    ASC_IS_ISAPNP) {
@@ -2955,7 +2881,7 @@
 			(ulong)adv_dvc_varp->iop_base + boardp->asc_n_io_port - 1, boardp->irq);
 	}
 	BUG_ON(strlen(info) >= ASC_INFO_SIZE);
-	ASC_DBG(1, "advansys_info: end\n");
+	ASC_DBG(1, "end\n");
 	return info;
 }
 
@@ -4118,12 +4044,12 @@
 {
 	int cnt = 0;
 
-	ASC_DBG3(2, "asc_proc_copy: offset %d, advoffset %d, cplen %d\n",
+	ASC_DBG(2, "offset %d, advoffset %d, cplen %d\n",
 		 (unsigned)offset, (unsigned)advoffset, cplen);
 	if (offset <= advoffset) {
 		/* Read offset below current offset, copy everything. */
 		cnt = min(cplen, leftlen);
-		ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n",
+		ASC_DBG(2, "curbuf 0x%lx, cp 0x%lx, cnt %d\n",
 			 (ulong)curbuf, (ulong)cp, cnt);
 		memcpy(curbuf, cp, cnt);
 	} else if (offset < advoffset + cplen) {
@@ -4131,7 +4057,7 @@
 		cnt = (advoffset + cplen) - offset;
 		cp = (cp + cplen) - cnt;
 		cnt = min(cnt, leftlen);
-		ASC_DBG3(2, "asc_proc_copy: curbuf 0x%lx, cp 0x%lx, cnt %d\n",
+		ASC_DBG(2, "curbuf 0x%lx, cp 0x%lx, cnt %d\n",
 			 (ulong)curbuf, (ulong)cp, cnt);
 		memcpy(curbuf, cp, cnt);
 	}
@@ -4270,7 +4196,7 @@
 	char *curbuf;
 	off_t advoffset;
 
-	ASC_DBG(1, "advansys_proc_info: begin\n");
+	ASC_DBG(1, "begin\n");
 
 	/*
 	 * User write not supported.
@@ -4302,7 +4228,7 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
@@ -4320,7 +4246,7 @@
 		totcnt += cnt;
 		leftlen -= cnt;
 		if (leftlen == 0) {
-			ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+			ASC_DBG(1, "totcnt %d\n", totcnt);
 			return totcnt;
 		}
 		advoffset += cplen;
@@ -4337,7 +4263,7 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
@@ -4357,7 +4283,7 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
@@ -4373,7 +4299,7 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
@@ -4390,7 +4316,7 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
@@ -4412,13 +4338,13 @@
 	totcnt += cnt;
 	leftlen -= cnt;
 	if (leftlen == 0) {
-		ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+		ASC_DBG(1, "totcnt %d\n", totcnt);
 		return totcnt;
 	}
 	advoffset += cplen;
 	curbuf += cnt;
 
-	ASC_DBG1(1, "advansys_proc_info: totcnt %d\n", totcnt);
+	ASC_DBG(1, "totcnt %d\n", totcnt);
 
 	return totcnt;
 }
@@ -4530,11 +4456,10 @@
 {
 	ushort sig_word;
 
-	ASC_DBG2(1, "AscFindSignature: AscGetChipSignatureByte(0x%x) 0x%x\n",
+	ASC_DBG(1, "AscGetChipSignatureByte(0x%x) 0x%x\n",
 		 iop_base, AscGetChipSignatureByte(iop_base));
 	if (AscGetChipSignatureByte(iop_base) == (uchar)ASC_1000_ID1B) {
-		ASC_DBG2(1,
-			 "AscFindSignature: AscGetChipSignatureWord(0x%x) 0x%x\n",
+		ASC_DBG(1, "AscGetChipSignatureWord(0x%x) 0x%x\n",
 			 iop_base, AscGetChipSignatureWord(iop_base));
 		sig_word = AscGetChipSignatureWord(iop_base);
 		if ((sig_word == (ushort)ASC_1000_ID0W) ||
@@ -4785,18 +4710,17 @@
 	AscMemWordCopyPtrToLram(iop_base, s_addr, mcode_buf, mcode_word_size);
 
 	chksum = AscMemSumLramWord(iop_base, s_addr, mcode_word_size);
-	ASC_DBG1(1, "AscLoadMicroCode: chksum 0x%lx\n", (ulong)chksum);
+	ASC_DBG(1, "chksum 0x%lx\n", (ulong)chksum);
 	mcode_chksum = (ushort)AscMemSumLramWord(iop_base,
 						 (ushort)ASC_CODE_SEC_BEG,
 						 (ushort)((mcode_size -
 							   s_addr - (ushort)
 							   ASC_CODE_SEC_BEG) /
 							  2));
-	ASC_DBG1(1, "AscLoadMicroCode: mcode_chksum 0x%lx\n",
-		 (ulong)mcode_chksum);
+	ASC_DBG(1, "mcode_chksum 0x%lx\n", (ulong)mcode_chksum);
 	AscWriteLramWord(iop_base, ASCV_MCODE_CHKSUM_W, mcode_chksum);
 	AscWriteLramWord(iop_base, ASCV_MCODE_SIZE_W, mcode_size);
-	return (chksum);
+	return chksum;
 }
 
 /* Microcode buffer is kept after initialization for error recovery. */
@@ -6511,8 +6435,7 @@
 	warn_code |= AscInitLram(asc_dvc);
 	if (asc_dvc->err_code != 0)
 		return UW_ERR;
-	ASC_DBG1(1, "AscInitAsc1000Driver: _asc_mcode_chksum 0x%lx\n",
-		 (ulong)_asc_mcode_chksum);
+	ASC_DBG(1, "_asc_mcode_chksum 0x%lx\n", (ulong)_asc_mcode_chksum);
 	if (AscLoadMicroCode(iop_base, 0, _asc_mcode_buf,
 			     _asc_mcode_size) != _asc_mcode_chksum) {
 		asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM;
@@ -6613,7 +6536,7 @@
 {
 	ADV_PADDR paddr = virt_to_bus(vaddr);
 
-	ASC_DBG4(4, "DvcGetPhyAddr: vaddr 0x%p, lenp 0x%p *lenp %lu, paddr 0x%lx\n",
+	ASC_DBG(4, "vaddr 0x%p, lenp 0x%p *lenp %lu, paddr 0x%lx\n",
 		 vaddr, lenp, (ulong)*((ulong *)lenp), (ulong)paddr);
 
 	return paddr;
@@ -8291,8 +8214,7 @@
 		/*
 		 * The firmware detected a SCSI Bus reset.
 		 */
-		ASC_DBG(0,
-			"adv_async_callback: ADV_ASYNC_SCSI_BUS_RESET_DET\n");
+		ASC_DBG(0, "ADV_ASYNC_SCSI_BUS_RESET_DET\n");
 		break;
 
 	case ADV_ASYNC_RDMA_FAILURE:
@@ -8301,7 +8223,7 @@
 		 * possibly the chip if it is unresponsive. Log the error
 		 * with a unique code.
 		 */
-		ASC_DBG(0, "adv_async_callback: ADV_ASYNC_RDMA_FAILURE\n");
+		ASC_DBG(0, "ADV_ASYNC_RDMA_FAILURE\n");
 		AdvResetChipAndSB(adv_dvc_varp);
 		break;
 
@@ -8309,11 +8231,11 @@
 		/*
 		 * Host generated SCSI bus reset occurred.
 		 */
-		ASC_DBG(0, "adv_async_callback: ADV_HOST_SCSI_BUS_RESET\n");
+		ASC_DBG(0, "ADV_HOST_SCSI_BUS_RESET\n");
 		break;
 
 	default:
-		ASC_DBG1(0, "DvcAsyncCallBack: unknown code 0x%x\n", code);
+		ASC_DBG(0, "unknown code 0x%x\n", code);
 		break;
 	}
 }
@@ -8332,7 +8254,7 @@
 	struct Scsi_Host *shost;
 	ADV_DCNT resid_cnt;
 
-	ASC_DBG2(1, "adv_isr_callback: adv_dvc_varp 0x%lx, scsiqp 0x%lx\n",
+	ASC_DBG(1, "adv_dvc_varp 0x%lx, scsiqp 0x%lx\n",
 		 (ulong)adv_dvc_varp, (ulong)scsiqp);
 	ASC_DBG_PRT_ADV_SCSI_REQ_Q(2, scsiqp);
 
@@ -8342,7 +8264,7 @@
 	 * completed ADV_SCSI_REQ_Q structure.
 	 */
 	reqp = (adv_req_t *)ADV_U32_TO_VADDR(scsiqp->srb_ptr);
-	ASC_DBG1(1, "adv_isr_callback: reqp 0x%lx\n", (ulong)reqp);
+	ASC_DBG(1, "reqp 0x%lx\n", (ulong)reqp);
 	if (reqp == NULL) {
 		ASC_PRINT("adv_isr_callback: reqp is NULL\n");
 		return;
@@ -8357,7 +8279,7 @@
 	 * determined.
 	 */
 	scp = reqp->cmndp;
-	ASC_DBG1(1, "adv_isr_callback: scp 0x%lx\n", (ulong)scp);
+	ASC_DBG(1, "scp 0x%p\n", scp);
 	if (scp == NULL) {
 		ASC_PRINT
 		    ("adv_isr_callback: scp is NULL; adv_req_t dropped.\n");
@@ -8367,7 +8289,7 @@
 
 	shost = scp->device->host;
 	ASC_STATS(shost, callback);
-	ASC_DBG1(1, "adv_isr_callback: shost 0x%lx\n", (ulong)shost);
+	ASC_DBG(1, "shost 0x%p\n", shost);
 
 	boardp = shost_priv(shost);
 	BUG_ON(adv_dvc_varp != &boardp->dvc_var.adv_dvc_var);
@@ -8377,7 +8299,7 @@
 	 */
 	switch (scsiqp->done_status) {
 	case QD_NO_ERROR:
-		ASC_DBG(2, "adv_isr_callback: QD_NO_ERROR\n");
+		ASC_DBG(2, "QD_NO_ERROR\n");
 		scp->result = 0;
 
 		/*
@@ -8389,20 +8311,18 @@
 		resid_cnt = le32_to_cpu(scsiqp->data_cnt);
 		if (scp->request_bufflen != 0 && resid_cnt != 0 &&
 		    resid_cnt <= scp->request_bufflen) {
-			ASC_DBG1(1,
-				 "adv_isr_callback: underrun condition %lu bytes\n",
+			ASC_DBG(1, "underrun condition %lu bytes\n",
 				 (ulong)resid_cnt);
 			scp->resid = resid_cnt;
 		}
 		break;
 
 	case QD_WITH_ERROR:
-		ASC_DBG(2, "adv_isr_callback: QD_WITH_ERROR\n");
+		ASC_DBG(2, "QD_WITH_ERROR\n");
 		switch (scsiqp->host_status) {
 		case QHSTA_NO_ERROR:
 			if (scsiqp->scsi_status == SAM_STAT_CHECK_CONDITION) {
-				ASC_DBG(2,
-					"adv_isr_callback: SAM_STAT_CHECK_CONDITION\n");
+				ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
 				ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
 						  sizeof(scp->sense_buffer));
 				/*
@@ -8426,22 +8346,20 @@
 
 		default:
 			/* Some other QHSTA error occurred. */
-			ASC_DBG1(1, "adv_isr_callback: host_status 0x%x\n",
-				 scsiqp->host_status);
+			ASC_DBG(1, "host_status 0x%x\n", scsiqp->host_status);
 			scp->result = HOST_BYTE(DID_BAD_TARGET);
 			break;
 		}
 		break;
 
 	case QD_ABORTED_BY_HOST:
-		ASC_DBG(1, "adv_isr_callback: QD_ABORTED_BY_HOST\n");
+		ASC_DBG(1, "QD_ABORTED_BY_HOST\n");
 		scp->result =
 		    HOST_BYTE(DID_ABORT) | STATUS_BYTE(scsiqp->scsi_status);
 		break;
 
 	default:
-		ASC_DBG1(1, "adv_isr_callback: done_status 0x%x\n",
-			 scsiqp->done_status);
+		ASC_DBG(1, "done_status 0x%x\n", scsiqp->done_status);
 		scp->result =
 		    HOST_BYTE(DID_ERROR) | STATUS_BYTE(scsiqp->scsi_status);
 		break;
@@ -8479,7 +8397,7 @@
 	reqp->next_reqp = boardp->adv_reqp;
 	boardp->adv_reqp = reqp;
 
-	ASC_DBG(1, "adv_isr_callback: done\n");
+	ASC_DBG(1, "done\n");
 
 	return;
 }
@@ -9299,8 +9217,7 @@
 	struct scsi_cmnd *scp;
 	struct Scsi_Host *shost;
 
-	ASC_DBG2(1, "asc_isr_callback: asc_dvc_varp 0x%lx, qdonep 0x%lx\n",
-		 (ulong)asc_dvc_varp, (ulong)qdonep);
+	ASC_DBG(1, "asc_dvc_varp 0x%p, qdonep 0x%p\n", asc_dvc_varp, qdonep);
 	ASC_DBG_PRT_ASC_QDONE_INFO(2, qdonep);
 
 	/*
@@ -9308,7 +9225,7 @@
 	 * command that has been completed.
 	 */
 	scp = (struct scsi_cmnd *)ASC_U32_TO_VADDR(qdonep->d2.srb_ptr);
-	ASC_DBG1(1, "asc_isr_callback: scp 0x%lx\n", (ulong)scp);
+	ASC_DBG(1, "scp 0x%p\n", scp);
 
 	if (scp == NULL) {
 		ASC_PRINT("asc_isr_callback: scp is NULL\n");
@@ -9318,7 +9235,7 @@
 
 	shost = scp->device->host;
 	ASC_STATS(shost, callback);
-	ASC_DBG1(1, "asc_isr_callback: shost 0x%lx\n", (ulong)shost);
+	ASC_DBG(1, "shost 0x%p\n", shost);
 
 	boardp = shost_priv(shost);
 	BUG_ON(asc_dvc_varp != &boardp->dvc_var.asc_dvc_var);
@@ -9328,7 +9245,7 @@
 	 */
 	switch (qdonep->d3.done_stat) {
 	case QD_NO_ERROR:
-		ASC_DBG(2, "asc_isr_callback: QD_NO_ERROR\n");
+		ASC_DBG(2, "QD_NO_ERROR\n");
 		scp->result = 0;
 
 		/*
@@ -9339,20 +9256,18 @@
 		 */
 		if (scp->request_bufflen != 0 && qdonep->remain_bytes != 0 &&
 		    qdonep->remain_bytes <= scp->request_bufflen) {
-			ASC_DBG1(1,
-				 "asc_isr_callback: underrun condition %u bytes\n",
+			ASC_DBG(1, "underrun condition %u bytes\n",
 				 (unsigned)qdonep->remain_bytes);
 			scp->resid = qdonep->remain_bytes;
 		}
 		break;
 
 	case QD_WITH_ERROR:
-		ASC_DBG(2, "asc_isr_callback: QD_WITH_ERROR\n");
+		ASC_DBG(2, "QD_WITH_ERROR\n");
 		switch (qdonep->d3.host_stat) {
 		case QHSTA_NO_ERROR:
 			if (qdonep->d3.scsi_stat == SAM_STAT_CHECK_CONDITION) {
-				ASC_DBG(2,
-					"asc_isr_callback: SAM_STAT_CHECK_CONDITION\n");
+				ASC_DBG(2, "SAM_STAT_CHECK_CONDITION\n");
 				ASC_DBG_PRT_SENSE(2, scp->sense_buffer,
 						  sizeof(scp->sense_buffer));
 				/*
@@ -9376,15 +9291,14 @@
 
 		default:
 			/* QHSTA error occurred */
-			ASC_DBG1(1, "asc_isr_callback: host_stat 0x%x\n",
-				 qdonep->d3.host_stat);
+			ASC_DBG(1, "host_stat 0x%x\n", qdonep->d3.host_stat);
 			scp->result = HOST_BYTE(DID_BAD_TARGET);
 			break;
 		}
 		break;
 
 	case QD_ABORTED_BY_HOST:
-		ASC_DBG(1, "asc_isr_callback: QD_ABORTED_BY_HOST\n");
+		ASC_DBG(1, "QD_ABORTED_BY_HOST\n");
 		scp->result =
 		    HOST_BYTE(DID_ABORT) | MSG_BYTE(qdonep->d3.
 						    scsi_msg) |
@@ -9392,8 +9306,7 @@
 		break;
 
 	default:
-		ASC_DBG1(1, "asc_isr_callback: done_stat 0x%x\n",
-			 qdonep->d3.done_stat);
+		ASC_DBG(1, "done_stat 0x%x\n", qdonep->d3.done_stat);
 		scp->result =
 		    HOST_BYTE(DID_ERROR) | MSG_BYTE(qdonep->d3.
 						    scsi_msg) |
@@ -9681,7 +9594,7 @@
 	int status;
 	int ret = SUCCESS;
 
-	ASC_DBG1(1, "advansys_reset: 0x%p\n", scp);
+	ASC_DBG(1, "0x%p\n", scp);
 
 	ASC_STATS(shost, reset);
 
@@ -9691,7 +9604,7 @@
 		ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
 
 		/* Reset the chip and SCSI bus. */
-		ASC_DBG(1, "advansys_reset: before AscInitAsc1000Driver()\n");
+		ASC_DBG(1, "before AscInitAsc1000Driver()\n");
 		status = AscInitAsc1000Driver(asc_dvc);
 
 		/* Refer to ASC_IERR_* defintions for meaning of 'err_code'. */
@@ -9707,7 +9620,7 @@
 				    "successful\n");
 		}
 
-		ASC_DBG(1, "advansys_reset: after AscInitAsc1000Driver()\n");
+		ASC_DBG(1, "after AscInitAsc1000Driver()\n");
 		spin_lock_irqsave(&boardp->lock, flags);
 	} else {
 		/*
@@ -9719,7 +9632,7 @@
 		/*
 		 * Reset the target's SCSI bus.
 		 */
-		ASC_DBG(1, "advansys_reset: before AdvResetChipAndSB()\n");
+		ASC_DBG(1, "before AdvResetChipAndSB()\n");
 		switch (AdvResetChipAndSB(adv_dvc)) {
 		case ASC_TRUE:
 			scmd_printk(KERN_INFO, scp, "SCSI bus reset "
@@ -9739,7 +9652,7 @@
 	boardp->last_reset = jiffies;
 	spin_unlock_irqrestore(&boardp->lock, flags);
 
-	ASC_DBG1(1, "advansys_reset: ret %d\n", ret);
+	ASC_DBG(1, "ret %d\n", ret);
 
 	return ret;
 }
@@ -9761,7 +9674,7 @@
 {
 	struct asc_board *boardp = shost_priv(sdev->host);
 
-	ASC_DBG(1, "advansys_biosparam: begin\n");
+	ASC_DBG(1, "begin\n");
 	ASC_STATS(sdev->host, biosparam);
 	if (ASC_NARROW_BOARD(boardp)) {
 		if ((boardp->dvc_var.asc_dvc_var.dvc_cntl &
@@ -9783,7 +9696,7 @@
 		}
 	}
 	ip[2] = (unsigned long)capacity / (ip[0] * ip[1]);
-	ASC_DBG(1, "advansys_biosparam: end\n");
+	ASC_DBG(1, "end\n");
 	return 0;
 }
 
@@ -9799,17 +9712,17 @@
 	struct asc_board *boardp = shost_priv(shost);
 	irqreturn_t result = IRQ_NONE;
 
-	ASC_DBG1(2, "advansys_interrupt: boardp 0x%p\n", boardp);
+	ASC_DBG(2, "boardp 0x%p\n", boardp);
 	spin_lock_irqsave(&boardp->lock, flags);
 	if (ASC_NARROW_BOARD(boardp)) {
 		if (AscIsIntPending(shost->io_port)) {
 			result = IRQ_HANDLED;
 			ASC_STATS(shost, interrupt);
-			ASC_DBG(1, "advansys_interrupt: before AscISR()\n");
+			ASC_DBG(1, "before AscISR()\n");
 			AscISR(&boardp->dvc_var.asc_dvc_var);
 		}
 	} else {
-		ASC_DBG(1, "advansys_interrupt: before AdvISR()\n");
+		ASC_DBG(1, "before AdvISR()\n");
 		if (AdvISR(&boardp->dvc_var.adv_dvc_var)) {
 			result = IRQ_HANDLED;
 			ASC_STATS(shost, interrupt);
@@ -9817,7 +9730,7 @@
 	}
 	spin_unlock_irqrestore(&boardp->lock, flags);
 
-	ASC_DBG(1, "advansys_interrupt: end\n");
+	ASC_DBG(1, "end\n");
 	return result;
 }
 
@@ -10186,7 +10099,7 @@
 		}
 	}
 
-	ASC_DBG_PRT_ASC_SCSI_Q(2, &asc_scsi_q);
+	ASC_DBG_PRT_ASC_SCSI_Q(2, asc_scsi_q);
 	ASC_DBG_PRT_CDB(1, scp->cmnd, scp->cmd_len);
 
 	return ASC_NOERROR;
@@ -10229,7 +10142,7 @@
 		 * (15) scatter-gather elements.
 		 */
 		if ((sgblkp = boardp->adv_sgblkp) == NULL) {
-			ASC_DBG(1, "adv_get_sglist: no free adv_sgblk_t\n");
+			ASC_DBG(1, "no free adv_sgblk_t\n");
 			ASC_STATS(scp->device->host, adv_build_nosg);
 
 			/*
@@ -10328,7 +10241,7 @@
 	 * the command.
 	 */
 	if (boardp->adv_reqp == NULL) {
-		ASC_DBG(1, "adv_build_req: no free adv_req_t\n");
+		ASC_DBG(1, "no free adv_req_t\n");
 		ASC_STATS(scp->device->host, adv_build_noreq);
 		return ASC_BUSY;
 	} else {
@@ -11205,7 +11118,7 @@
 	int ret, err_code;
 	struct asc_board *boardp = shost_priv(scp->device->host);
 
-	ASC_DBG1(1, "asc_execute_scsi_cmnd: scp 0x%p\n", scp);
+	ASC_DBG(1, "scp 0x%p\n", scp);
 
 	if (ASC_NARROW_BOARD(boardp)) {
 		ASC_DVC_VAR *asc_dvc = &boardp->dvc_var.asc_dvc_var;
@@ -11227,12 +11140,10 @@
 
 		switch (adv_build_req(boardp, scp, &adv_scsiqp)) {
 		case ASC_NOERROR:
-			ASC_DBG(3, "asc_execute_scsi_cmnd: adv_build_req "
-				"ASC_NOERROR\n");
+			ASC_DBG(3, "adv_build_req ASC_NOERROR\n");
 			break;
 		case ASC_BUSY:
-			ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
-				"ASC_BUSY\n");
+			ASC_DBG(1, "adv_build_req ASC_BUSY\n");
 			/*
 			 * The asc_stats fields 'adv_build_noreq' and
 			 * 'adv_build_nosg' count wide board busy conditions.
@@ -11242,8 +11153,7 @@
 			return ASC_BUSY;
 		case ASC_ERROR:
 		default:
-			ASC_DBG(1, "asc_execute_scsi_cmnd: adv_build_req "
-				"ASC_ERROR\n");
+			ASC_DBG(1, "adv_build_req ASC_ERROR\n");
 			ASC_STATS(scp->device->host, build_error);
 			return ASC_ERROR;
 		}
@@ -11260,8 +11170,7 @@
 		 * successful request counter. Wrapping doesn't matter.
 		 */
 		boardp->reqcnt[scp->device->id]++;
-		ASC_DBG(1, "asc_execute_scsi_cmnd: ExeScsiQueue(), "
-			"ASC_NOERROR\n");
+		ASC_DBG(1, "ExeScsiQueue() ASC_NOERROR\n");
 		break;
 	case ASC_BUSY:
 		ASC_STATS(scp->device->host, exe_busy);
@@ -11280,7 +11189,7 @@
 		break;
 	}
 
-	ASC_DBG(1, "asc_execute_scsi_cmnd: end\n");
+	ASC_DBG(1, "end\n");
 	return ret;
 }
 
@@ -11911,7 +11820,7 @@
 		AscSetChipCfgMsw(iop_base, cfg_msw);
 	}
 	chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type);
-	ASC_DBG1(1, "AscInitFromEEP: chksum 0x%x\n", chksum);
+	ASC_DBG(1, "chksum 0x%x\n", chksum);
 	if (chksum == 0) {
 		chksum = 0xaa55;
 	}
@@ -11932,13 +11841,11 @@
 	}
 	eep_config->cfg_msw &= ~ASC_CFG_MSW_CLR_MASK;
 	eep_config->cfg_lsw |= ASC_CFG0_HOST_INT_ON;
-	ASC_DBG1(1, "AscInitFromEEP: eep_config->chksum 0x%x\n",
-		 eep_config->chksum);
+	ASC_DBG(1, "eep_config->chksum 0x%x\n", eep_config->chksum);
 	if (chksum != eep_config->chksum) {
 		if (AscGetChipVersion(iop_base, asc_dvc->bus_type) ==
 		    ASC_CHIP_VER_PCI_ULTRA_3050) {
-			ASC_DBG(1,
-				"AscInitFromEEP: chksum error ignored; EEPROM-less board\n");
+			ASC_DBG(1, "chksum error ignored; EEPROM-less board\n");
 			eep_config->init_sdtr = 0xFF;
 			eep_config->disc_enable = 0xFF;
 			eep_config->start_motor = 0xFF;
@@ -13517,11 +13424,11 @@
 	asc_dvc->cfg->chip_version =
 	    AdvGetChipVersion(iop_base, asc_dvc->bus_type);
 
-	ASC_DBG2(1, "AdvInitGetConfig: iopb_chip_id_1: 0x%x 0x%x\n",
+	ASC_DBG(1, "iopb_chip_id_1: 0x%x 0x%x\n",
 		 (ushort)AdvReadByteRegister(iop_base, IOPB_CHIP_ID_1),
 		 (ushort)ADV_CHIP_ID_BYTE);
 
-	ASC_DBG2(1, "AdvInitGetConfig: iopw_chip_id_0: 0x%x 0x%x\n",
+	ASC_DBG(1, "iopw_chip_id_0: 0x%x 0x%x\n",
 		 (ushort)AdvReadWordRegister(iop_base, IOPW_CHIP_ID_0),
 		 (ushort)ADV_CHIP_ID_WORD);
 
@@ -13616,7 +13523,7 @@
 	 * is about 4 KB, so allocate all at once.
 	 */
 	boardp->carrp = kmalloc(ADV_CARRIER_BUFSIZE, GFP_KERNEL);
-	ASC_DBG1(1, "advansys_wide_init_chip: carrp 0x%p\n", boardp->carrp);
+	ASC_DBG(1, "carrp 0x%p\n", boardp->carrp);
 
 	if (!boardp->carrp)
 		goto kmalloc_failed;
@@ -13629,8 +13536,7 @@
 	for (req_cnt = adv_dvc_varp->max_host_qng; req_cnt > 0; req_cnt--) {
 		reqp = kmalloc(sizeof(adv_req_t) * req_cnt, GFP_KERNEL);
 
-		ASC_DBG3(1, "advansys_wide_init_chip: reqp 0x%p, req_cnt %d, "
-			 "bytes %lu\n", reqp, req_cnt,
+		ASC_DBG(1, "reqp 0x%p, req_cnt %d, bytes %lu\n", reqp, req_cnt,
 			 (ulong)sizeof(adv_req_t) * req_cnt);
 
 		if (reqp)
@@ -13658,8 +13564,7 @@
 
 	}
 
-	ASC_DBG3(1, "advansys_wide_init_chip: sg_cnt %d * %u = %u bytes\n",
-		 sg_cnt, sizeof(adv_sgblk_t),
+	ASC_DBG(1, "sg_cnt %d * %u = %u bytes\n", sg_cnt, sizeof(adv_sgblk_t),
 		 (unsigned)(sizeof(adv_sgblk_t) * sg_cnt));
 
 	if (!boardp->adv_sgblkp)
@@ -13679,15 +13584,13 @@
 	boardp->adv_reqp = &reqp[0];
 
 	if (adv_dvc_varp->chip_type == ADV_CHIP_ASC3550) {
-		ASC_DBG(2, "advansys_wide_init_chip: AdvInitAsc3550Driver()\n");
+		ASC_DBG(2, "AdvInitAsc3550Driver()\n");
 		warn_code = AdvInitAsc3550Driver(adv_dvc_varp);
 	} else if (adv_dvc_varp->chip_type == ADV_CHIP_ASC38C0800) {
-		ASC_DBG(2, "advansys_wide_init_chip: AdvInitAsc38C0800Driver()"
-			   "\n");
+		ASC_DBG(2, "AdvInitAsc38C0800Driver()\n");
 		warn_code = AdvInitAsc38C0800Driver(adv_dvc_varp);
 	} else {
-		ASC_DBG(2, "advansys_wide_init_chip: AdvInitAsc38C1600Driver()"
-			   "\n");
+		ASC_DBG(2, "AdvInitAsc38C1600Driver()\n");
 		warn_code = AdvInitAsc38C1600Driver(adv_dvc_varp);
 	}
 	err_code = adv_dvc_varp->err_code;
@@ -13734,7 +13637,7 @@
 	pdev = (bus_type == ASC_IS_PCI) ? to_pci_dev(boardp->dev) : NULL;
 
 	if (ASC_NARROW_BOARD(boardp)) {
-		ASC_DBG(1, "advansys_board_found: narrow board\n");
+		ASC_DBG(1, "narrow board\n");
 		asc_dvc_varp = &boardp->dvc_var.asc_dvc_var;
 		asc_dvc_varp->bus_type = bus_type;
 		asc_dvc_varp->drv_ptr = boardp;
@@ -13743,18 +13646,17 @@
 		asc_dvc_varp->iop_base = iop;
 	} else {
 #ifdef CONFIG_PCI
-		ASC_DBG(1, "advansys_board_found: wide board\n");
 		adv_dvc_varp = &boardp->dvc_var.adv_dvc_var;
 		adv_dvc_varp->drv_ptr = boardp;
 		adv_dvc_varp->cfg = &boardp->dvc_cfg.adv_dvc_cfg;
 		if (pdev->device == PCI_DEVICE_ID_ASP_ABP940UW) {
-			ASC_DBG(1, "advansys_board_found: ASC-3550\n");
+			ASC_DBG(1, "wide board ASC-3550\n");
 			adv_dvc_varp->chip_type = ADV_CHIP_ASC3550;
 		} else if (pdev->device == PCI_DEVICE_ID_38C0800_REV1) {
-			ASC_DBG(1, "advansys_board_found: ASC-38C0800\n");
+			ASC_DBG(1, "wide board ASC-38C0800\n");
 			adv_dvc_varp->chip_type = ADV_CHIP_ASC38C0800;
 		} else {
-			ASC_DBG(1, "advansys_board_found: ASC-38C1600\n");
+			ASC_DBG(1, "wide board ASC-38C1600\n");
 			adv_dvc_varp->chip_type = ADV_CHIP_ASC38C1600;
 		}
 
@@ -13769,9 +13671,8 @@
 			ret = -ENODEV;
 			goto err_shost;
 		}
-		adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr
-		ASC_DBG1(1, "advansys_board_found: iop_base: 0x%lx\n",
-			 adv_dvc_varp->iop_base);
+		adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr;
+		ASC_DBG(1, "iop_base: 0x%p\n", adv_dvc_varp->iop_base);
 
 		/*
 		 * Even though it isn't used to access wide boards, other
@@ -13780,9 +13681,8 @@
 		 */
 		boardp->ioport = iop;
 
-		ASC_DBG2(1, "advansys_board_found: iopb_chip_id_1 0x%x, "
-			 "iopw_chip_id_0 0x%x\n", (ushort)inp(iop + 1),
-			 (ushort)inpw(iop));
+		ASC_DBG(1, "iopb_chip_id_1 0x%x, iopw_chip_id_0 0x%x\n",
+				(ushort)inp(iop + 1), (ushort)inpw(iop));
 #endif /* CONFIG_PCI */
 	}
 
@@ -13841,7 +13741,7 @@
 		 * longer be used. If the bus_type field must be
 		 * referenced only use the bit-wise AND operator "&".
 		 */
-		ASC_DBG(2, "advansys_board_found: AscInitGetConfig()\n");
+		ASC_DBG(2, "AscInitGetConfig()\n");
 		ret = AscInitGetConfig(boardp) ? -ENODEV : 0;
 	} else {
 #ifdef CONFIG_PCI
@@ -13851,7 +13751,7 @@
 		 */
 		shost->unchecked_isa_dma = FALSE;
 		share_irq = IRQF_SHARED;
-		ASC_DBG(2, "advansys_board_found: AdvInitGetConfig()\n");
+		ASC_DBG(2, "AdvInitGetConfig()\n");
 
 		ret = AdvInitGetConfig(pdev, boardp) ? -ENODEV : 0;
 #endif /* CONFIG_PCI */
@@ -13900,7 +13800,7 @@
 		/*
 		 * Modify board configuration.
 		 */
-		ASC_DBG(2, "advansys_board_found: AscInitSetConfig()\n");
+		ASC_DBG(2, "AscInitSetConfig()\n");
 		ret = AscInitSetConfig(pdev, boardp) ? -ENODEV : 0;
 		if (ret)
 			goto err_free_proc;
@@ -14081,7 +13981,7 @@
 		shost->sg_tablesize = SG_ALL;
 	}
 
-	ASC_DBG1(1, "advansys_board_found: sg_tablesize: %d\n", shost->sg_tablesize);
+	ASC_DBG(1, "sg_tablesize: %d\n", shost->sg_tablesize);
 
 	/* BIOS start address. */
 	if (ASC_NARROW_BOARD(boardp)) {
@@ -14101,12 +14001,10 @@
 		AdvReadWordLram(adv_dvc_varp->iop_base,
 				BIOS_CODELEN, boardp->bios_codelen);
 
-		ASC_DBG2(1,
-			 "advansys_board_found: bios_signature 0x%x, bios_version 0x%x\n",
+		ASC_DBG(1, "bios_signature 0x%x, bios_version 0x%x\n",
 			 boardp->bios_signature, boardp->bios_version);
 
-		ASC_DBG2(1,
-			 "advansys_board_found: bios_codeseg 0x%x, bios_codelen 0x%x\n",
+		ASC_DBG(1, "bios_codeseg 0x%x, bios_codelen 0x%x\n",
 			 boardp->bios_codeseg, boardp->bios_codelen);
 
 		/*
@@ -14148,7 +14046,7 @@
 #endif /* CONFIG_ISA */
 
 	/* Register IRQ Number. */
-	ASC_DBG1(2, "advansys_board_found: request_irq() %d\n", boardp->irq);
+	ASC_DBG(2, "request_irq(%d, %p)\n", boardp->irq, shost);
 
 	ret = request_irq(boardp->irq, advansys_interrupt, share_irq,
 			  DRV_NAME, shost);
@@ -14174,7 +14072,7 @@
 	 * Initialize board RISC chip and enable interrupts.
 	 */
 	if (ASC_NARROW_BOARD(boardp)) {
-		ASC_DBG(2, "advansys_board_found: AscInitAsc1000Driver()\n");
+		ASC_DBG(2, "AscInitAsc1000Driver()\n");
 		warn_code = AscInitAsc1000Driver(asc_dvc_varp);
 
 		if (warn_code || asc_dvc_varp->err_code) {
@@ -14225,11 +14123,11 @@
 static int advansys_release(struct Scsi_Host *shost)
 {
 	struct asc_board *boardp = shost_priv(shost);
-	ASC_DBG(1, "advansys_release: begin\n");
+	ASC_DBG(1, "begin\n");
 	scsi_remove_host(shost);
 	free_irq(boardp->irq, shost);
 	if (shost->dma_channel != NO_ISA_DMA) {
-		ASC_DBG(1, "advansys_release: free_dma()\n");
+		ASC_DBG(1, "free_dma()\n");
 		free_dma(shost->dma_channel);
 	}
 	if (!ASC_NARROW_BOARD(boardp)) {
@@ -14238,7 +14136,7 @@
 	}
 	kfree(boardp->prtbuf);
 	scsi_host_put(shost);
-	ASC_DBG(1, "advansys_release: end\n");
+	ASC_DBG(1, "end\n");
 	return 0;
 }
 
@@ -14273,11 +14171,10 @@
 	struct asc_board *board;
 
 	if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) {
-		ASC_DBG1(1, "advansys_isa_match: I/O port 0x%x busy\n",
-			 iop_base);
+		ASC_DBG(1, "I/O port 0x%x busy\n", iop_base);
 		return -ENODEV;
 	}
-	ASC_DBG1(1, "advansys_isa_match: probing I/O port 0x%x\n", iop_base);
+	ASC_DBG(1, "probing I/O port 0x%x\n", iop_base);
 	if (!AscFindSignature(iop_base))
 		goto release_region;
 	if (!(AscGetChipVersion(iop_base, ASC_IS_ISA) & ASC_CHIP_VER_ISA_BIT))
@@ -14351,11 +14248,10 @@
 	struct asc_board *board;
 
 	if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) {
-		ASC_DBG1(1, "advansys_vlb_match: I/O port 0x%x busy\n",
-			 iop_base);
+		ASC_DBG(1, "I/O port 0x%x busy\n", iop_base);
 		return -ENODEV;
 	}
-	ASC_DBG1(1, "advansys_vlb_match: probing I/O port 0x%x\n", iop_base);
+	ASC_DBG(1, "probing I/O port 0x%x\n", iop_base);
 	if (!AscFindSignature(iop_base))
 		goto release_region;
 	/*
