public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: "James E.J. Bottomley" <JBottomley@parallels.com>,
	<linux-scsi@vger.kernel.org>
Cc: Sam Creasey <sammy@sammy.net>,
	Russell King <linux@arm.linux.org.uk>,
	Michael Schmitz <schmitz@debian.org>,
	Joe Perches <joe@perches.com>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-m68k@vger.kernel.org>
Subject: [PATCH v2 07/12] scsi/NCR5380: adopt NCR5380_dprint() and NCR5380_dprint_phase()
Date: Wed, 19 Mar 2014 23:35:23 +1100	[thread overview]
Message-ID: <20140319123518.642821564@telegraphics.com.au> (raw)
In-Reply-To: 20140319123516.542623278@telegraphics.com.au

[-- Attachment #1: ncr5380-debug-macros-substitute-NCRPRINT --]
[-- Type: text/plain, Size: 7254 bytes --]

All NCR5380 drivers already include the NCR5380.h header. Better to
adopt those macros rather than have three variations on them.

Moreover, the macros in NCR5380.h are preferable anyway: the atari_NCR5380
and sun3_NCR5380 versions are inflexible. For example, they can't accomodate
NCR5380_dprint(NDEBUG_MAIN | NDEBUG_QUEUES, ...)

Replace the NCR_PRINT* macros from atari_NCR5380.h and sun3_NCR5380.h with
the equivalent macros from NCR5380.h.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---
 drivers/scsi/atari_NCR5380.c |   22 +++++++++++-----------
 drivers/scsi/sun3_NCR5380.c  |   22 +++++++++++-----------
 2 files changed, 22 insertions(+), 22 deletions(-)

Index: linux-m68k/drivers/scsi/atari_NCR5380.c
===================================================================
--- linux-m68k.orig/drivers/scsi/atari_NCR5380.c	2014-03-19 23:23:02.000000000 +1100
+++ linux-m68k/drivers/scsi/atari_NCR5380.c	2014-03-19 23:34:43.000000000 +1100
@@ -739,8 +739,8 @@ static void NCR5380_print_status(struct
 	Scsi_Cmnd *ptr;
 	unsigned long flags;
 
-	NCR_PRINT(NDEBUG_ANY);
-	NCR_PRINT_PHASE(NDEBUG_ANY);
+	NCR5380_dprint(NDEBUG_ANY, instance);
+	NCR5380_dprint_phase(NDEBUG_ANY, instance);
 
 	hostdata = (struct NCR5380_hostdata *)instance->hostdata;
 
@@ -1268,7 +1268,7 @@ static irqreturn_t NCR5380_intr(int irq,
 	INT_PRINTK("scsi%d: BASR=%02x\n", HOSTNO, basr);
 	/* dispatch to appropriate routine if found and done=0 */
 	if (basr & BASR_IRQ) {
-		NCR_PRINT(NDEBUG_INTR);
+		NCR5380_dprint(NDEBUG_INTR, instance);
 		if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
 			done = 0;
 			ENABLE_IRQ();
@@ -1396,7 +1396,7 @@ static int NCR5380_select(struct Scsi_Ho
 	unsigned long flags;
 
 	hostdata->restart_select = 0;
-	NCR_PRINT(NDEBUG_ARBITRATION);
+	NCR5380_dprint(NDEBUG_ARBITRATION, instance);
 	ARB_PRINTK("scsi%d: starting arbitration, id = %d\n", HOSTNO,
 		   instance->this_id);
 
@@ -1617,7 +1617,7 @@ static int NCR5380_select(struct Scsi_Ho
 			printk(KERN_ERR "scsi%d: weirdness\n", HOSTNO);
 			if (hostdata->restart_select)
 				printk(KERN_NOTICE "\trestart select\n");
-			NCR_PRINT(NDEBUG_ANY);
+			NCR5380_dprint(NDEBUG_ANY, instance);
 			NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
 			return -1;
 		}
@@ -1742,7 +1742,7 @@ static int NCR5380_transfer_pio(struct S
 		/* Check for phase mismatch */
 		if ((tmp & PHASE_MASK) != p) {
 			PIO_PRINTK("scsi%d: phase mismatch\n", HOSTNO);
-			NCR_PRINT_PHASE(NDEBUG_PIO);
+			NCR5380_dprint_phase(NDEBUG_PIO, instance);
 			break;
 		}
 
@@ -1764,18 +1764,18 @@ static int NCR5380_transfer_pio(struct S
 		if (!(p & SR_IO)) {
 			if (!((p & SR_MSG) && c > 1)) {
 				NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA);
-				NCR_PRINT(NDEBUG_PIO);
+				NCR5380_dprint(NDEBUG_PIO, instance);
 				NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
 					      ICR_ASSERT_DATA | ICR_ASSERT_ACK);
 			} else {
 				NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
 					      ICR_ASSERT_DATA | ICR_ASSERT_ATN);
-				NCR_PRINT(NDEBUG_PIO);
+				NCR5380_dprint(NDEBUG_PIO, instance);
 				NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
 					      ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
 			}
 		} else {
-			NCR_PRINT(NDEBUG_PIO);
+			NCR5380_dprint(NDEBUG_PIO, instance);
 			NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ACK);
 		}
 
@@ -1997,7 +1997,7 @@ static void NCR5380_information_transfer
 			phase = (tmp & PHASE_MASK);
 			if (phase != old_phase) {
 				old_phase = phase;
-				NCR_PRINT_PHASE(NDEBUG_INFORMATION);
+				NCR5380_dprint_phase(NDEBUG_INFORMATION, instance);
 			}
 
 			if (sink && (phase != PHASE_MSGOUT)) {
@@ -2451,7 +2451,7 @@ static void NCR5380_information_transfer
 				break;
 			default:
 				printk("scsi%d: unknown phase\n", HOSTNO);
-				NCR_PRINT(NDEBUG_ANY);
+				NCR5380_dprint(NDEBUG_ANY, instance);
 			} /* switch(phase) */
 		} /* if (tmp * SR_REQ) */
 	} /* while (1) */
Index: linux-m68k/drivers/scsi/sun3_NCR5380.c
===================================================================
--- linux-m68k.orig/drivers/scsi/sun3_NCR5380.c	2014-03-19 23:34:42.000000000 +1100
+++ linux-m68k/drivers/scsi/sun3_NCR5380.c	2014-03-19 23:34:43.000000000 +1100
@@ -681,8 +681,8 @@ static void NCR5380_print_status(struct
 	Scsi_Cmnd *ptr;
 	unsigned long flags;
 
-	NCR_PRINT(NDEBUG_ANY);
-	NCR_PRINT_PHASE(NDEBUG_ANY);
+	NCR5380_dprint(NDEBUG_ANY, instance);
+	NCR5380_dprint_phase(NDEBUG_ANY, instance);
 
 	hostdata = (struct NCR5380_hostdata *)instance->hostdata;
 
@@ -1192,7 +1192,7 @@ static irqreturn_t NCR5380_intr (int irq
     INT_PRINTK("scsi%d: BASR=%02x\n", HOSTNO, basr);
     /* dispatch to appropriate routine if found and done=0 */
     if (basr & BASR_IRQ) {
-	NCR_PRINT(NDEBUG_INTR);
+	NCR5380_dprint(NDEBUG_INTR, instance);
 	if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
 	    done = 0;
 //	    ENABLE_IRQ();
@@ -1334,7 +1334,7 @@ static int NCR5380_select(struct Scsi_Ho
     unsigned long flags;
 
     hostdata->restart_select = 0;
-    NCR_PRINT(NDEBUG_ARBITRATION);
+    NCR5380_dprint(NDEBUG_ARBITRATION, instance);
     ARB_PRINTK("scsi%d: starting arbitration, id = %d\n", HOSTNO,
 	       instance->this_id);
 
@@ -1555,7 +1555,7 @@ static int NCR5380_select(struct Scsi_Ho
 	    printk(KERN_ERR "scsi%d: weirdness\n", HOSTNO);
 	    if (hostdata->restart_select)
 		printk(KERN_NOTICE "\trestart select\n");
-	    NCR_PRINT(NDEBUG_ANY);
+	    NCR5380_dprint(NDEBUG_ANY, instance);
 	    NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
 	    return -1;
 	}
@@ -1681,7 +1681,7 @@ static int NCR5380_transfer_pio( struct
 	/* Check for phase mismatch */	
 	if ((tmp & PHASE_MASK) != p) {
 	    PIO_PRINTK("scsi%d: phase mismatch\n", HOSTNO);
-	    NCR_PRINT_PHASE(NDEBUG_PIO);
+	    NCR5380_dprint_phase(NDEBUG_PIO, instance);
 	    break;
 	}
 
@@ -1704,18 +1704,18 @@ static int NCR5380_transfer_pio( struct
 	    if (!((p & SR_MSG) && c > 1)) {
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
 		    ICR_ASSERT_DATA);
-		NCR_PRINT(NDEBUG_PIO);
+		NCR5380_dprint(NDEBUG_PIO, instance);
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
 			ICR_ASSERT_DATA | ICR_ASSERT_ACK);
 	    } else {
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE |
 		    ICR_ASSERT_DATA | ICR_ASSERT_ATN);
-		NCR_PRINT(NDEBUG_PIO);
+		NCR5380_dprint(NDEBUG_PIO, instance);
 		NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | 
 		    ICR_ASSERT_DATA | ICR_ASSERT_ATN | ICR_ASSERT_ACK);
 	    }
 	} else {
-	    NCR_PRINT(NDEBUG_PIO);
+	    NCR5380_dprint(NDEBUG_PIO, instance);
 	    NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ACK);
 	}
 
@@ -1927,7 +1927,7 @@ static void NCR5380_information_transfer
 	    phase = (tmp & PHASE_MASK); 
  	    if (phase != old_phase) {
 		old_phase = phase;
-		NCR_PRINT_PHASE(NDEBUG_INFORMATION);
+		NCR5380_dprint_phase(NDEBUG_INFORMATION, instance);
 	    }
 
 	    if(phase == PHASE_CMDOUT) {
@@ -2412,7 +2412,7 @@ static void NCR5380_information_transfer
 		break;
 	    default:
 		printk("scsi%d: unknown phase\n", HOSTNO);
-		NCR_PRINT(NDEBUG_ANY);
+		NCR5380_dprint(NDEBUG_ANY, instance);
 	    } /* switch(phase) */
 	} /* if (tmp * SR_REQ) */ 
     } /* while (1) */


  parent reply	other threads:[~2014-03-19 23:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-19 12:35 [PATCH v2 00/12] scsi/NCR5380: fix debugging macros and #include structure Finn Thain
2014-03-19 12:35 ` [PATCH v2 01/12] scsi/NCR5380: remove unused BOARD_NORMAL and BOARD_NCR53C400 Finn Thain
2014-03-19 12:35 ` [PATCH v2 02/12] scsi/NCR5380: remove redundant HOSTS_C macro tests Finn Thain
2014-03-19 12:35 ` [PATCH v2 03/12] scsi/NCR5380: remove old CVS keywords Finn Thain
2014-03-19 12:35 ` [PATCH v2 04/12] scsi/NCR5380: use NCR5380_dprint() instead of NCR5380_print() Finn Thain
2014-03-19 12:35 ` [PATCH v2 05/12] scsi/NCR5380: fix build failures when debugging is enabled Finn Thain
2014-03-19 12:35 ` [PATCH v2 06/12] scsi/NCR5380: fix dprintk macro usage and definition Finn Thain
2014-03-19 12:35 ` Finn Thain [this message]
2014-04-26  1:51   ` [PATCH v2 07/12] scsi/NCR5380: adopt NCR5380_dprint() and NCR5380_dprint_phase() Michael Schmitz
2014-03-19 12:35 ` [PATCH v2 08/12] scsi/NCR5380: adopt dprintk() Finn Thain
2014-04-26  1:52   ` Michael Schmitz
2014-03-19 12:35 ` [PATCH v2 09/12] scsi/NCR5380: fix and standardize NDEBUG macros Finn Thain
2014-03-19 12:35 ` [PATCH v2 10/12] scsi/NCR5380: remove unused macro definitions Finn Thain
2014-04-26  1:53   ` Michael Schmitz
2014-03-19 12:35 ` [PATCH v2 11/12] scsi/NCR5380: reduce depth of sun3_scsi nested includes Finn Thain
2014-03-19 12:35 ` [PATCH v2 12/12] scsi/NCR5380: merge sun3_scsi_vme.c into sun3_scsi.c Finn Thain
2014-04-11 14:39 ` [PATCH v2 00/12] scsi/NCR5380: fix debugging macros and #include structure Sam Creasey
2014-04-26 17:21 ` James Bottomley
2014-04-29  2:22   ` Finn Thain
2014-04-29  3:15     ` Michael Schmitz
2014-04-29 14:41       ` James Bottomley
2014-04-30  7:45         ` Michael Schmitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140319123518.642821564@telegraphics.com.au \
    --to=fthain@telegraphics.com.au \
    --cc=JBottomley@parallels.com \
    --cc=joe@perches.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=sammy@sammy.net \
    --cc=schmitz@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox