[PATCH 15/40] ide-{floppy,tape,scsi}: log device name instead of driver name

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Bartlomiej Zolnierkiewicz
Date: Sunday, May 18, 2008 - 11:56 am

Log device name instead of driver name in *_pc_intr() and *_transfer_pc*().

While at it:

* Merge two consecutive printk()-s in *_pc_intr() together.

* Replace "floppy"/"tape"/"scsi" references in printk()-s by "device".

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-floppy.c |   35 ++++++++++++++++++-----------------
 drivers/ide/ide-tape.c   |   42 ++++++++++++++++++++++--------------------
 drivers/scsi/ide-scsi.c  |   24 +++++++++++++-----------
 3 files changed, 53 insertions(+), 48 deletions(-)

Index: b/drivers/ide/ide-floppy.c
===================================================================
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -438,8 +438,8 @@ static ide_startstop_t idefloppy_pc_intr
 			debug_log("%s: I/O error\n", drive->name);
 			rq->errors++;
 			if (pc->c[0] == GPCMD_REQUEST_SENSE) {
-				printk(KERN_ERR "ide-floppy: I/O error in "
-					"request sense command\n");
+				printk(KERN_ERR "%s: I/O error in request sense"
+						" command\n", drive->name);
 				return ide_do_reset(drive);
 			}
 			/* Retry operation */
@@ -457,8 +457,8 @@ static ide_startstop_t idefloppy_pc_intr
 
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
-		printk(KERN_ERR "ide-floppy: The floppy wants to issue "
-			"more interrupts in DMA mode\n");
+		printk(KERN_ERR "%s: The device wants to issue more interrupts "
+				"in DMA mode\n", drive->name);
 		ide_dma_off(drive);
 		return ide_do_reset(drive);
 	}
@@ -470,14 +470,14 @@ static ide_startstop_t idefloppy_pc_intr
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 
 	if (ireason & CD) {
-		printk(KERN_ERR "ide-floppy: CoD != 0 in %s\n", __func__);
+		printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
 		return ide_do_reset(drive);
 	}
 	if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
 		/* Hopefully, we will never get here */
-		printk(KERN_ERR "ide-floppy: We wanted to %s, ",
-				(ireason & IO) ? "Write" : "Read");
-		printk(KERN_ERR "but the floppy wants us to %s !\n",
+		printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
+				"to %s!\n", drive->name,
+				(ireason & IO) ? "Write" : "Read",
 				(ireason & IO) ? "Read" : "Write");
 		return ide_do_reset(drive);
 	}
@@ -486,9 +486,10 @@ static ide_startstop_t idefloppy_pc_intr
 		temp = pc->xferred + bcount;
 		if (temp > pc->req_xfer) {
 			if (temp > pc->buf_size) {
-				printk(KERN_ERR "ide-floppy: The floppy wants "
-					"to send us more data than expected "
-					"- discarding data\n");
+				printk(KERN_ERR "%s: The device wants to send "
+						"us more data than expected - "
+						"discarding data\n",
+						drive->name);
 				ide_pad_transfer(drive, 0, bcount);
 
 				ide_set_handler(drive,
@@ -497,8 +498,8 @@ static ide_startstop_t idefloppy_pc_intr
 						NULL);
 				return ide_started;
 			}
-			debug_log("The floppy wants to send us more data than"
-					" expected - allowing transfer\n");
+			debug_log("The device wants to send us more data than "
+				  "expected - allowing transfer\n");
 		}
 	}
 	if (pc->flags & PC_FLAG_WRITING)
@@ -552,14 +553,14 @@ static ide_startstop_t idefloppy_transfe
 	u8 ireason;
 
 	if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
-		printk(KERN_ERR "ide-floppy: Strange, packet command "
-				"initiated yet DRQ isn't asserted\n");
+		printk(KERN_ERR "%s: Strange, packet command initiated yet "
+				"DRQ isn't asserted\n", drive->name);
 		return startstop;
 	}
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 	if ((ireason & CD) == 0 || (ireason & IO)) {
-		printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) "
-				"while issuing a packet command\n");
+		printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
+				"a packet command\n", drive->name);
 		return ide_do_reset(drive);
 	}
 	/*
Index: b/drivers/ide/ide-tape.c
===================================================================
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -776,8 +776,8 @@ static ide_startstop_t idetape_pc_intr(i
 			debug_log(DBG_ERR, "%s: I/O error\n", tape->name);
 
 			if (pc->c[0] == REQUEST_SENSE) {
-				printk(KERN_ERR "ide-tape: I/O error in request"
-						" sense command\n");
+				printk(KERN_ERR "%s: I/O error in request sense"
+						" command\n", drive->name);
 				return ide_do_reset(drive);
 			}
 			debug_log(DBG_ERR, "[cmd %x]: check condition\n",
@@ -805,8 +805,8 @@ static ide_startstop_t idetape_pc_intr(i
 
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
-		printk(KERN_ERR "ide-tape: The tape wants to issue more "
-				"interrupts in DMA mode\n");
+		printk(KERN_ERR "%s: The device wants to issue more interrupts "
+				"in DMA mode\n", drive->name);
 		ide_dma_off(drive);
 		return ide_do_reset(drive);
 	}
@@ -817,14 +817,14 @@ static ide_startstop_t idetape_pc_intr(i
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 
 	if (ireason & CD) {
-		printk(KERN_ERR "ide-tape: CoD != 0 in %s\n", __func__);
+		printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
 		return ide_do_reset(drive);
 	}
 	if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
 		/* Hopefully, we will never get here */
-		printk(KERN_ERR "ide-tape: We wanted to %s, ",
-				(ireason & IO) ? "Write" : "Read");
-		printk(KERN_ERR "ide-tape: but the tape wants us to %s !\n",
+		printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
+				"to %s!\n", drive->name,
+				(ireason & IO) ? "Write" : "Read",
 				(ireason & IO) ? "Read" : "Write");
 		return ide_do_reset(drive);
 	}
@@ -833,15 +833,16 @@ static ide_startstop_t idetape_pc_intr(i
 		temp = pc->xferred + bcount;
 		if (temp > pc->req_xfer) {
 			if (temp > pc->buf_size) {
-				printk(KERN_ERR "ide-tape: The tape wants to "
-					"send us more data than expected "
-					"- discarding data\n");
+				printk(KERN_ERR "%s: The device wants to send "
+						"us more data than expected - "
+						"discarding data\n",
+						drive->name);
 				ide_pad_transfer(drive, 0, bcount);
 				ide_set_handler(drive, &idetape_pc_intr,
 						IDETAPE_WAIT_CMD, NULL);
 				return ide_started;
 			}
-			debug_log(DBG_SENSE, "The tape wants to send us more "
+			debug_log(DBG_SENSE, "The device wants to send us more "
 				"data than expected - allowing transfer\n");
 		}
 		iobuf = &idetape_input_buffers;
@@ -914,26 +915,27 @@ static ide_startstop_t idetape_transfer_
 	u8 ireason;
 
 	if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
-		printk(KERN_ERR "ide-tape: Strange, packet command initiated "
-				"yet DRQ isn't asserted\n");
+		printk(KERN_ERR "%s: Strange, packet command initiated yet "
+				"DRQ isn't asserted\n", drive->name);
 		return startstop;
 	}
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 	while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) {
-		printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing "
-				"a packet command, retrying\n");
+		printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
+				"a packet command, retrying\n", drive->name);
 		udelay(100);
 		ireason = hwif->INB(hwif->io_ports.nsect_addr);
 		if (retries == 0) {
-			printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while "
-					"issuing a packet command, ignoring\n");
+			printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
+					"a packet command, ignoring\n",
+					drive->name);
 			ireason |= CD;
 			ireason &= ~IO;
 		}
 	}
 	if ((ireason & CD) == 0 || (ireason & IO)) {
-		printk(KERN_ERR "ide-tape: (IO,CoD) != (0,1) while issuing "
-				"a packet command\n");
+		printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
+				"a packet command\n", drive->name);
 		return ide_do_reset(drive);
 	}
 	/* Set the interrupt routine */
Index: b/drivers/scsi/ide-scsi.c
===================================================================
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -391,7 +391,7 @@ static ide_startstop_t idescsi_pc_intr (
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 
 	if (ireason & CD) {
-		printk(KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n");
+		printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
 		return ide_do_reset (drive);
 	}
 	if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
@@ -406,9 +406,10 @@ static ide_startstop_t idescsi_pc_intr (
 		temp = pc->xferred + bcount;
 		if (temp > pc->req_xfer) {
 			if (temp > pc->buf_size) {
-				printk(KERN_ERR "ide-scsi: The scsi wants to "
-					"send us more data than expected "
-					"- discarding data\n");
+				printk(KERN_ERR "%s: The device wants to send "
+						"us more data than expected - "
+						"discarding data\n",
+						drive->name);
 				temp = pc->buf_size - pc->xferred;
 				if (temp) {
 					if (pc->sg)
@@ -417,8 +418,9 @@ static ide_startstop_t idescsi_pc_intr (
 					else
 						hwif->input_data(drive, NULL,
 							pc->cur_pos, temp);
-					printk(KERN_ERR "ide-scsi: transferred"
-							" %d of %d bytes\n",
+					printk(KERN_ERR "%s: transferred %d of "
+							"%d bytes\n",
+							drive->name,
 							temp, bcount);
 				}
 				pc->xferred += temp;
@@ -427,7 +429,7 @@ static ide_startstop_t idescsi_pc_intr (
 				ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
 				return ide_started;
 			}
-			debug_log("The scsi wants to send us more data than "
+			debug_log("The device wants to send us more data than "
 				  "expected - allowing transfer\n");
 		}
 		xferfunc = hwif->input_data;
@@ -458,14 +460,14 @@ static ide_startstop_t idescsi_transfer_
 	u8 ireason;
 
 	if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) {
-		printk(KERN_ERR "ide-scsi: Strange, packet command "
-			"initiated yet DRQ isn't asserted\n");
+		printk(KERN_ERR "%s: Strange, packet command initiated yet "
+				"DRQ isn't asserted\n", drive->name);
 		return startstop;
 	}
 	ireason = hwif->INB(hwif->io_ports.nsect_addr);
 	if ((ireason & CD) == 0 || (ireason & IO)) {
-		printk(KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while "
-				"issuing a packet command\n");
+		printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
+				"a packet command\n", drive->name);
 		return ide_do_reset (drive);
 	}
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/40] ide: generic ATAPI support, Bartlomiej Zolnierki ..., (Sun May 18, 11:54 am)
[PATCH 01/40] ide-scsi: fix race in idescsi_transfer_pc(), Bartlomiej Zolnierki ..., (Sun May 18, 11:54 am)
[PATCH 02/40] ide-scsi: fix DRQ checking for DMA transfers ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:54 am)
[PATCH 03/40] ide-scsi: fix handling of DMA errors in ides ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:54 am)
[PATCH 04/40] ide-scsi: fix Interrupt Reason checking in i ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 05/40] ide-scsi: merge idescsi_input_buffers() and ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 06/40] ide-scsi: remove superfluous BUG_ON() from i ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 07/40] ide-scsi: add debug_log() macro, Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 08/40] ide-tape: idetape_pc_intr() should use local ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 09/40] ide-tape: remove superfluous error message f ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 10/40] ide-tape: remove superfluous warning message ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:55 am)
[PATCH 11/40] ide-tape: remove unneeded CONFIG_BLK_DEV_IDE ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 12/40] ide-tape: remove stale comments from idetape ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 13/40] ide-tape: remove SIMULATE_ERRORS debug code, Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc() an ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 15/40] ide-{floppy,tape,scsi}: log device name inst ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 16/40] ide-tape: make idetape_retry_pc() void, Bartlomiej Zolnierki ..., (Sun May 18, 11:56 am)
[PATCH 17/40] ide-tape: merge callbacks, Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 18/40] ide-tape: make pc-&gt;idetape_callback void, Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 19/40] ide-floppy: merge callbacks, Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 20/40] ide-{floppy,tape}: merge pc-&gt;idefloppy_callb ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 21/40] ide-{floppy,tape}: PC_FLAG_DMA_RECOMMENDED - ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 22/40] ide-floppy: start DMA engine in idefloppy_tr ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 23/40] ide-tape: set PC_FLAG_DMA_IN_PROGRESS flag i ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:57 am)
[PATCH 24/40] ide-tape: factor out waiting for good ireaso ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 25/40] ide: add PC_FLAG_ZIP_DRIVE pc flag, Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 26/40] ide-{cd,floppy,tape}: remove checking for dr ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 27/40] ide-scsi: set drive-&gt;scsi flag for devices h ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 28/40] ide: add ide_transfer_pc() helper, Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 29/40] ide-scsi: move idescsi_map_sg() call out fro ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 30/40] ide: add PC_FLAG_DRQ_INTERRUPT pc flag, Bartlomiej Zolnierki ..., (Sun May 18, 11:58 am)
[PATCH 31/40] ide: add ide_issue_pc() helper, Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 32/40] ide-{floppy,tape}: move checking of -&gt;failed ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 33/40] ide-tape: factor out DSC handling from ideta ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 34/40] ide-tape: add ide_tape_io_buffers() helper, Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 35/40] ide-tape: always log debug info in idetape_p ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 36/40] ide-floppy: add more debugging to idefloppy_ ..., Bartlomiej Zolnierki ..., (Sun May 18, 11:59 am)
[PATCH 37/40] ide-scsi: use pc-&gt;callback, Bartlomiej Zolnierki ..., (Sun May 18, 12:00 pm)
[PATCH 38/40] ide-scsi: add more debugging to idescsi_pc_i ..., Bartlomiej Zolnierki ..., (Sun May 18, 12:00 pm)
[PATCH 39/40] ide-{floppy,scsi}: read Status Register befo ..., Bartlomiej Zolnierki ..., (Sun May 18, 12:00 pm)
[PATCH 40/40] ide: add ide_pc_intr() helper, Bartlomiej Zolnierki ..., (Sun May 18, 12:00 pm)
Re: [PATCH 04/40] ide-scsi: fix Interrupt Reason checking ..., Borislav Petkov, (Sun May 18, 10:10 pm)
Re: [PATCH 00/40] ide: generic ATAPI support, Borislav Petkov, (Thu May 22, 12:43 am)
Re: [PATCH 00/40] ide: generic ATAPI support, Bartlomiej Zolnierki ..., (Sun May 25, 6:23 am)
Re: [PATCH 04/40] ide-scsi: fix Interrupt Reason checking ..., Bartlomiej Zolnierki ..., (Tue May 27, 11:30 am)
Re: [PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc( ..., Bartlomiej Zolnierki ..., (Tue May 27, 11:57 am)
Re: [PATCH 22/40] ide-floppy: start DMA engine in ideflopp ..., Bartlomiej Zolnierki ..., (Tue May 27, 11:58 am)
Re: [PATCH 14/40] ide-floppy: merge idefloppy_transfer_pc( ..., Bartlomiej Zolnierki ..., (Thu May 29, 4:01 pm)