Skip to contentSkip to conversation

drivers/ide/ide-core: Use dev_<level> and pr_<level>

PATCH In review Joe Perches 3 participants 10 messages May 23, 2009 – Jun 2, 2009 libata

lore
Share & tools
lore
#0 lore raw

cover drivers/ide/ide-core: Use dev_<level> and pr_<level>

Mostly mechanical patches to transform printk calls to dev_<level> and pr_<level>.

Against linux-next

Joe Perches (3):
drivers/ide/ide-core: Convert printk(KERN_<level> to dev_<level> drivers/ide/ide-core: Convert printk(KERN_<level> to pr_<level> drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

 drivers/ide/ide-acpi.c      |   18 +++----
 drivers/ide/ide-atapi.c     |   76 +++++++++++++++----------------
 drivers/ide/ide-dma-sff.c   |    6 +-
 drivers/ide/ide-dma.c       |   28 ++++++------
 drivers/ide/ide-eh.c        |   26 +++++-----
 drivers/ide/ide-io.c        |   19 +++-----
 drivers/ide/ide-ioctls.c    |    4 +-
 drivers/ide/ide-iops.c      |    9 ++--
 drivers/ide/ide-legacy.c    |    7 +--
 drivers/ide/ide-lib.c       |   68 ++++++++++++++--------------
 drivers/ide/ide-pm.c        |    8 ++--
 drivers/ide/ide-probe.c     |  106 ++++++++++++++++++++++---------------------
 drivers/ide/ide-proc.c      |   16 +++----
 drivers/ide/ide-scan-pci.c  |    4 +-
 drivers/ide/ide-taskfile.c  |   23 +++++-----
 drivers/ide/ide-xfer-mode.c |    6 +-
 drivers/ide/ide.c           |   24 ++++------
 drivers/ide/setup-pci.c     |   91 +++++++++++++++++++------------------
 18 files changed, 263 insertions(+), 276 deletions(-)
#1 lore raw

PATCH 1/3 drivers/ide/ide-core: Convert printk(KERN_<level> to dev_<level>

When hwif->name or drive->name is printed.

There is a single #ifdef DEBUG printk(KERN_DEBUG
that is also converted to dev_dbg.

---
 drivers/ide/ide-atapi.c     |   74 ++++++++++++++++++++++---------------------
 drivers/ide/ide-dma-sff.c   |    6 ++--
 drivers/ide/ide-dma.c       |   28 ++++++++--------
 drivers/ide/ide-eh.c        |   18 +++++-----
 drivers/ide/ide-io.c        |   18 +++-------
 drivers/ide/ide-ioctls.c    |    4 +-
 drivers/ide/ide-iops.c      |    9 ++---
 drivers/ide/ide-lib.c       |    4 +-
 drivers/ide/ide-pm.c        |    8 ++--
 drivers/ide/ide-probe.c     |   69 ++++++++++++++++++++-------------------
 drivers/ide/ide-taskfile.c  |   22 ++++++-------
 drivers/ide/ide-xfer-mode.c |    6 ++--
 drivers/ide/ide.c           |   20 +++++-------
 drivers/ide/setup-pci.c     |    7 ++--
 14 files changed, 142 insertions(+), 151 deletions(-)
drivers/ide/ide-atapi.c +38 -36
index ffa1bb8..fc5cfb6 100644
@@ -50,21 +50,21 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
 #endif
 
 	if (protocol != 2)
-		printk(KERN_ERR "%s: %s: protocol (0x%02x) is not ATAPI\n",
-			s, drive->name, protocol);
+		dev_err(&drive->gendev, "%s: protocol (0x%02x) is not ATAPI\n",
+			s, protocol);
 	else if ((drive->media == ide_floppy && device_type != 0) ||
 		 (drive->media == ide_tape && device_type != 1))
-		printk(KERN_ERR "%s: %s: invalid device type (0x%02x)\n",
-			s, drive->name, device_type);
+		dev_err(&drive->gendev, "%s: invalid device type (0x%02x)\n",
+			s, device_type);
 	else if (removable == 0)
-		printk(KERN_ERR "%s: %s: the removable flag is not set\n",
-			s, drive->name);
+		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
+			s);
 	else if (drive->media == ide_floppy && drq_type == 3)
-		printk(KERN_ERR "%s: %s: sorry, DRQ type (0x%02x) not "
-			"supported\n", s, drive->name, drq_type);
+		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
+			"supported\n", s, drq_type);
 	else if (packet_size != 0)
-		printk(KERN_ERR "%s: %s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, drive->name, packet_size);
+		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
+			"bytes\n", s, packet_size);
 	else
 		return 1;
 	return 0;
@@ -201,8 +201,8 @@ void ide_prep_sense(ide_drive_t *drive, struct request *rq)
 			      GFP_NOIO);
 	if (unlikely(err)) {
 		if (printk_ratelimit())
-			printk(KERN_WARNING "%s: failed to map sense buffer\n",
-			       drive->name);
+			dev_warn(&drive->gendev,
+				 "failed to map sense buffer\n");
 		return;
 	}
 
@@ -223,8 +223,7 @@ int ide_queue_sense_rq(ide_drive_t *drive, void *special)
 {
 	/* deferred failure from ide_prep_sense() */
 	if (!drive->sense_rq_armed) {
-		printk(KERN_WARNING "%s: failed queue sense request\n",
-		       drive->name);
+		dev_warn(&drive->gendev, "failed queue sense request\n");
 		return -ENOMEM;
 	}
 
@@ -365,9 +364,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 
 		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
 			if (drive->media == ide_floppy)
-				printk(KERN_ERR "%s: DMA %s error\n",
-					drive->name, rq_data_dir(pc->rq)
-						     ? "write" : "read");
+				dev_err(&drive->gendev, "DMA %s error\n",
+					rq_data_dir(pc->rq) ? "write" : "read");
 			pc->flags |= PC_FLAG_DMA_ERROR;
 		} else
 			pc->xferred = pc->req_xfer;
@@ -397,8 +395,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 				pc->rq->errors++;
 
 			if (rq->cmd[0] == REQUEST_SENSE) {
-				printk(KERN_ERR "%s: I/O error in request sense"
-						" command\n", drive->name);
+				dev_err(&drive->gendev,
+					"I/O error in request sense command\n");
 				return ide_do_reset(drive);
 			}
 
@@ -440,8 +438,9 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
-		printk(KERN_ERR "%s: The device wants to issue more interrupts "
-				"in DMA mode\n", drive->name);
+		dev_err(&drive->gendev,
+			"The device wants to issue more interrupts "
+			"in DMA mode\n");
 		ide_dma_off(drive);
 		return ide_do_reset(drive);
 	}
@@ -450,16 +449,16 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 	ide_read_bcount_and_ireason(drive, &bcount, &ireason);
 
 	if (ireason & ATAPI_COD) {
-		printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
+		dev_err(&drive->gendev, "CoD != 0 in %s\n", __func__);
 		return ide_do_reset(drive);
 	}
 
 	if (((ireason & ATAPI_IO) == ATAPI_IO) == write) {
 		/* Hopefully, we will never get here */
-		printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
-				"to %s!\n", drive->name,
-				(ireason & ATAPI_IO) ? "Write" : "Read",
-				(ireason & ATAPI_IO) ? "Read" : "Write");
+		dev_err(&drive->gendev,
+			"We wanted to %s, but the device wants us to %s!\n",
+			(ireason & ATAPI_IO) ? "Write" : "Read",
+			(ireason & ATAPI_IO) ? "Read" : "Write");
 		return ide_do_reset(drive);
 	}
 
@@ -508,15 +507,16 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
 	int retries = 100;
 
 	while (retries-- && ((ireason & ATAPI_COD) == 0 ||
-		(ireason & ATAPI_IO))) {
-		printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
-				"a packet command, retrying\n", drive->name);
+			     (ireason & ATAPI_IO))) {
+		dev_err(&drive->gendev,
+			"(IO,CoD != (0,1) while issuing "
+			"a packet command, retrying\n");
 		udelay(100);
 		ireason = ide_read_ireason(drive);
 		if (retries == 0) {
-			printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing "
-					"a packet command, ignoring\n",
-					drive->name);
+			dev_err(&drive->gendev,
+				"(IO,CoD != (0,1) while issuing "
+				"a packet command, ignoring\n");
 			ireason |= ATAPI_COD;
 			ireason &= ~ATAPI_IO;
 		}
@@ -546,8 +546,9 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 	u8 ireason;
 
 	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
-		printk(KERN_ERR "%s: Strange, packet command initiated yet "
-				"DRQ isn't asserted\n", drive->name);
+		dev_err(&drive->gendev,
+			"Strange, packet command initiated yet "
+			"DRQ isn't asserted\n");
 		return startstop;
 	}
 
@@ -588,8 +589,9 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 			ireason = ide_wait_ireason(drive, ireason);
 
 		if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
-			printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
-					"a packet command\n", drive->name);
+			dev_err(&drive->gendev,
+				"(IO,CoD) != (0,1) while issuing "
+				"a packet command\n");
 
 			return ide_do_reset(drive);
 		}
drivers/ide/ide-dma-sff.c +3 -3
index e4cdf78..9fcebf3 100644
@@ -162,7 +162,7 @@ int ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd)
 	}
 
 use_pio_instead:
-	printk(KERN_ERR "%s: %s\n", drive->name,
+	dev_err(&drive->gendev, "%s\n",
 		count ? "DMA table too small" : "empty DMA table?");
 
 	return 0; /* revert to PIO for this request */
@@ -238,8 +238,8 @@ int ide_dma_sff_timer_expiry(ide_drive_t *drive)
 	ide_hwif_t *hwif = drive->hwif;
 	u8 dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 
-	printk(KERN_WARNING "%s: %s: DMA status (0x%02x)\n",
-		drive->name, __func__, dma_stat);
+	dev_warn(&drive->gendev, "%s: DMA status (0x%02x)\n",
+		 __func__, dma_stat);
 
 	if ((dma_stat & 0x18) == 0x18)	/* BUSY Stupid Early Timer !! */
 		return WAIT_CMD;
drivers/ide/ide-dma.c +14 -14
index 001f68f..47c2bde 100644
@@ -106,8 +106,8 @@ ide_startstop_t ide_dma_intr(ide_drive_t *drive)
 						blk_rq_sectors(cmd->rq) << 9);
 			return ide_stopped;
 		}
-		printk(KERN_ERR "%s: %s: bad DMA status (0x%02x)\n",
-			drive->name, __func__, dma_stat);
+		dev_err(&drive->gendev, "%s: bad DMA status (0x%02x)\n",
+			__func__, dma_stat);
 	}
 	return ide_error(drive, "dma_intr", stat);
 }
@@ -194,7 +194,7 @@ EXPORT_SYMBOL(ide_dma_off_quietly);
 
 void ide_dma_off(ide_drive_t *drive)
 {
-	printk(KERN_INFO "%s: DMA disabled\n", drive->name);
+	dev_info(&drive->gendev, "DMA disabled\n");
 	ide_dma_off_quietly(drive);
 }
 EXPORT_SYMBOL(ide_dma_off);
@@ -220,8 +220,9 @@ int __ide_dma_bad_drive(ide_drive_t *drive)
 
 	int blacklist = ide_in_drive_list(id, drive_blacklist);
 	if (blacklist) {
-		printk(KERN_WARNING "%s: Disabling (U)DMA for %s (blacklisted)\n",
-				    drive->name, (char *)&id[ATA_ID_PROD]);
+		dev_warn(&drive->gendev,
+			 "Disabling (U)DMA for %s (blacklisted)\n",
+			 (char *)&id[ATA_ID_PROD]);
 		return blacklist;
 	}
 	return 0;
@@ -342,8 +343,8 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
 
 	mode = min(mode, req_mode);
 
-	printk(KERN_INFO "%s: %s mode selected\n", drive->name,
-			  mode ? ide_xfer_verbose(mode) : "no DMA");
+	dev_info(&drive->gendev, "%s mode selected\n",
+		 mode ? ide_xfer_verbose(mode) : "no DMA");
 
 	return mode;
 }
@@ -409,7 +410,7 @@ int ide_id_dma_bug(ide_drive_t *drive)
 
 	return 0;
 err_out:
-	printk(KERN_ERR "%s: bad DMA info in identify block\n", drive->name);
+	dev_err(&drive->gendev, "bad DMA info in identify block\n");
 	return 1;
 }
 
@@ -456,7 +457,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
 
 void ide_dma_lost_irq(ide_drive_t *drive)
 {
-	printk(KERN_ERR "%s: DMA interrupt recovery\n", drive->name);
+	dev_err(&drive->gendev, "DMA interrupt recovery\n");
 }
 EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
 
@@ -478,17 +479,17 @@ ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
 	 */
 
 	if (error < 0) {
-		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
+		dev_warn(&drive->gendev, "DMA timeout error\n");
 		drive->waiting_for_dma = 0;
 		(void)dma_ops->dma_end(drive);
 		ide_dma_unmap_sg(drive, cmd);
 		ret = ide_error(drive, "dma timeout error",
 				hwif->tp_ops->read_status(hwif));
 	} else {
-		printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name);
+		dev_warn(&drive->gendev, "DMA timeout retry\n");
 		if (dma_ops->dma_clear)
 			dma_ops->dma_clear(drive);
-		printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name);
+		dev_err(&drive->gendev, "timeout waiting for DMA\n");
 		if (dma_ops->dma_test_irq(drive) == 0) {
 			ide_dump_status(drive, "DMA timeout",
 					hwif->tp_ops->read_status(hwif));
@@ -545,8 +546,7 @@ int ide_allocate_dma_engine(ide_hwif_t *hwif)
 						&hwif->dmatable_dma,
 						GFP_ATOMIC);
 	if (hwif->dmatable_cpu == NULL) {
-		printk(KERN_ERR "%s: unable to allocate PRD table\n",
-			hwif->name);
+		dev_err(&hwif->gendev, "unable to allocate PRD table\n");
 		return -ENOMEM;
 	}
 
drivers/ide/ide-eh.c +9 -9
index 39d5892..75019ce 100644
@@ -173,7 +173,7 @@ static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive)
 	stat = tp_ops->read_status(hwif);
 
 	if (OK_STAT(stat, 0, ATA_BUSY))
-		printk(KERN_INFO "%s: ATAPI reset complete\n", drive->name);
+		dev_info(&drive->gendev, "ATAPI reset complete\n");
 	else {
 		if (time_before(jiffies, hwif->poll_timeout)) {
 			ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20);
@@ -182,8 +182,8 @@ static ide_startstop_t atapi_reset_pollfunc(ide_drive_t *drive)
 		}
 		/* end of polling */
 		hwif->polling = 0;
-		printk(KERN_ERR "%s: ATAPI reset timed-out, status=0x%02x\n",
-			drive->name, stat);
+		dev_err(&drive->gendev,
+			"ATAPI reset timed-out, status=0x%02x\n", stat);
 		/* do it the old fashioned way */
 		return do_reset1(drive, 1);
 	}
@@ -202,7 +202,7 @@ static void ide_reset_report_error(ide_hwif_t *hwif, u8 err)
 
 	u8 err_master = err & 0x7f;
 
-	printk(KERN_ERR "%s: reset: master: ", hwif->name);
+	dev_err(&hwif->gendev, "reset: master: ");
 	if (err_master && err_master < 6)
 		printk(KERN_CONT "%s", err_master_vals[err_master]);
 	else
@@ -228,8 +228,9 @@ static ide_startstop_t reset_pollfunc(ide_drive_t *drive)
 	if (port_ops && port_ops->reset_poll) {
 		err = port_ops->reset_poll(drive);
 		if (err) {
-			printk(KERN_ERR "%s: host reset_poll failure for %s.\n",
-				hwif->name, drive->name);
+			dev_err(&hwif->gendev,
+				"host reset_poll failure for %s.\n",
+				drive->name);
 			goto out;
 		}
 	}
@@ -242,15 +243,14 @@ static ide_startstop_t reset_pollfunc(ide_drive_t *drive)
 			/* continue polling */
 			return ide_started;
 		}
-		printk(KERN_ERR "%s: reset timed-out, status=0x%02x\n",
-			hwif->name, tmp);
+		dev_err(&hwif->gendev, "reset timed-out, status=0x%02x\n", tmp);
 		drive->failures++;
 		err = -EIO;
 	} else  {
 		tmp = ide_read_error(drive);
 
 		if (tmp == 1) {
-			printk(KERN_INFO "%s: reset: success\n", hwif->name);
+			dev_info(&hwif->gendev, "reset: success\n");
 			drive->failures = 0;
 		} else {
 			ide_reset_report_error(hwif, tmp);
drivers/ide/ide-io.c +6 -12
index 5015c5c..51c7cb4 100644
@@ -95,8 +95,7 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err)
 	if ((cmd->tf_flags & IDE_TFLAG_CUSTOM_HANDLER) &&
 	    tf_cmd == ATA_CMD_IDLEIMMEDIATE) {
 		if (tf->lbal != 0xc4) {
-			printk(KERN_ERR "%s: head unload failed!\n",
-			       drive->name);
+			dev_err(&drive->gendev, "head unload failed!\n");
 			ide_tf_dump(drive->name, cmd);
 		} else
 			drive->dev_flags |= IDE_DFLAG_PARKED;
@@ -196,10 +195,7 @@ static ide_startstop_t do_special(ide_drive_t *drive)
 {
 	struct ide_cmd cmd;
 
-#ifdef DEBUG
-	printk(KERN_DEBUG "%s: %s: 0x%02x\n", drive->name, __func__,
-		drive->special_flags);
-#endif
+	dev_dbg(&drive->gendev, "%s: 0x%02x\n", __func__, drive->special_flags);
 	if (drive->media != ide_disk) {
 		drive->special_flags = 0;
 		drive->mult_req = 0;
@@ -336,7 +332,7 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
 	drive->hwif->tp_ops->dev_select(drive);
 	if (ide_wait_stat(&startstop, drive, drive->ready_stat,
 			  ATA_BUSY | ATA_DRQ, WAIT_READY)) {
-		printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
+		dev_err(&drive->gendev, "drive not ready for command\n");
 		return startstop;
 	}
 
@@ -681,8 +677,7 @@ void ide_timer_expiry (unsigned long data)
 				hwif->dma_ops->dma_lost_irq(drive);
 			if (hwif->ack_intr)
 				hwif->ack_intr(hwif);
-			printk(KERN_WARNING "%s: lost interrupt\n",
-				drive->name);
+			dev_warn(&drive->gendev, "lost interrupt\n");
 			startstop = handler(drive);
 		} else {
 			if (drive->waiting_for_dma)
@@ -748,9 +743,8 @@ static void unexpected_intr(int irq, ide_hwif_t *hwif)
 
 		if (time_after(jiffies, last_msgtime + HZ)) {
 			last_msgtime = jiffies;
-			printk(KERN_ERR "%s: unexpected interrupt, "
-				"status=0x%02x, count=%ld\n",
-				hwif->name, stat, count);
+			dev_err(&hwif->gendev, "unexpected interrupt, "
+				"status=0x%02x, count=%ld\n", stat, count);
 		}
 	}
 }
drivers/ide/ide-ioctls.c +2 -2
index 5991b23..866b29b 100644
@@ -167,8 +167,8 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
 	     id[ATA_ID_SWDMA_MODES])) {
 		xfer_rate = args[1];
 		if (tf->nsect > XFER_UDMA_2 && !eighty_ninty_three(drive)) {
-			printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot "
-					    "be set\n", drive->name);
+			dev_warn(&drive->gendev,
+				 "UDMA speeds >UDMA33 cannot be set\n");
 			goto abort;
 		}
 	}
drivers/ide/ide-iops.c +4 -5
index c19a221..6dbb96e 100644
@@ -259,10 +259,9 @@ no_80w:
 	if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
 		return 0;
 
-	printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, "
-			    "limiting max speed to UDMA33\n",
-			    drive->name,
-			    hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");
+	dev_warn(&drive->gendev, "%s side 80-wire cable detection failed, "
+		 "limiting max speed to UDMA33\n",
+		 hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");
 
 	drive->dev_flags |= IDE_DFLAG_UDMA33_WARNED;
 
@@ -300,7 +299,7 @@ int ide_driveid_update(ide_drive_t *drive)
 out_err:
 	SELECT_MASK(drive, 0);
 	if (rc == 2)
-		printk(KERN_ERR "%s: %s: bad status\n", drive->name, __func__);
+		dev_err(&drive->gendev, "%s: bad status\n", __func__);
 	kfree(id);
 	return 0;
 }
drivers/ide/ide-lib.c +2 -2
index 05b7fbc..f7432c5 100644
@@ -151,7 +151,7 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
 {
 	u8 err = 0;
 
-	printk(KERN_ERR "%s: %s: status=0x%02x { ", drive->name, msg, stat);
+	dev_err(&drive->gendev, "%s: status=0x%02x { ", msg, stat);
 	if (stat & ATA_BUSY)
 		printk(KERN_CONT "Busy ");
 	else {
@@ -173,7 +173,7 @@ u8 ide_dump_status(ide_drive_t *drive, const char *msg, u8 stat)
 	printk(KERN_CONT "}\n");
 	if ((stat & (ATA_BUSY | ATA_ERR)) == ATA_ERR) {
 		err = ide_read_error(drive);
-		printk(KERN_ERR "%s: %s: error=0x%02x ", drive->name, msg, err);
+		dev_err(&drive->gendev, "%s: error=0x%02x ", msg, err);
 		if (drive->media == ide_disk)
 			ide_dump_ata_error(drive, err);
 		else
drivers/ide/ide-pm.c +4 -4
index c14ca14..f72531a 100644
@@ -76,8 +76,8 @@ void ide_complete_power_step(ide_drive_t *drive, struct request *rq)
 	struct request_pm_state *pm = rq->special;
 
 #ifdef DEBUG_PM
-	printk(KERN_INFO "%s: complete_power_step(step: %d)\n",
-		drive->name, pm->pm_step);
+	dev_info(&drive->gendev, "complete_power_step(step: %d)\n",
+		 pm->pm_step);
 #endif
 	if (drive->media != ide_disk)
 		return;
@@ -227,12 +227,12 @@ void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
 #endif
 		rc = ide_wait_not_busy(hwif, 35000);
 		if (rc)
-			printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
+			dev_warn(&drive->gendev, "bus not ready on wakeup\n");
 		tp_ops->dev_select(drive);
 		tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
 		rc = ide_wait_not_busy(hwif, 100000);
 		if (rc)
-			printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
+			dev_warn(&drive->gendev, "drive not ready on wakeup\n");
 
 		spin_lock_irqsave(q->queue_lock, flags);
 		blk_start_queue(q);
drivers/ide/ide-probe.c +35 -34

169 lines not on this page · raw message

drivers/ide/ide-taskfile.c +10 -12
index 908e6c7..8d741d1 100644
@@ -86,7 +86,7 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd)
 	if (orig_cmd->protocol == ATA_PROT_PIO &&
 	    (orig_cmd->tf_flags & IDE_TFLAG_MULTI_PIO) &&
 	    drive->mult_count == 0) {
-		printk(KERN_ERR "%s: multimode not set!\n", drive->name);
+		dev_err(&drive->gendev, "multimode not set!\n");
 		return ide_stopped;
 	}
 
@@ -215,7 +215,7 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
 	}
 
 	if (stat & ATA_BUSY)
-		printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);
+		dev_err(&drive->gendev, "drive still BUSY!\n");
 
 	return stat;
 }
@@ -399,8 +399,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive,
 
 	if (ide_wait_stat(&startstop, drive, ATA_DRQ,
 			  drive->bad_wstat, WAIT_DRQ)) {
-		printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
-			drive->name,
+		dev_err(&drive->gendev, "no DRQ after issuing %sWRITE%s\n",
 			(cmd->tf_flags & IDE_TFLAG_MULTI_PIO) ? "MULT" : "",
 			(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
 		return startstop;
@@ -580,9 +579,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 		case TASKFILE_MULTI_OUT:
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
-				printk(KERN_ERR "%s: %s Multimode Write " \
-					"multcount is not set\n",
-					drive->name, __func__);
+				dev_err(&drive->gendev, "%s Multimode Write " \
+					"multcount is not set\n", __func__);
 				err = -EPERM;
 				goto abort;
 			}
@@ -600,9 +598,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 		case TASKFILE_MULTI_IN:
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
-				printk(KERN_ERR "%s: %s Multimode Read failure " \
-					"multcount is not set\n",
-					drive->name, __func__);
+				dev_err(&drive->gendev,
+					"%s Multimode Read failure "
+					"multcount is not set\n", __func__);
 				err = -EPERM;
 				goto abort;
 			}
@@ -630,8 +628,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 		nsect = (cmd.hob.nsect << 8) | cmd.tf.nsect;
 
 		if (!nsect) {
-			printk(KERN_ERR "%s: in/out command without data\n",
-					drive->name);
+			dev_err(&drive->gendev,
+				"in/out command without data\n");
 			err = -EFAULT;
 			goto abort;
 		}
drivers/ide/ide-xfer-mode.c +3 -3
index af44be9..023d6bb 100644
@@ -70,7 +70,7 @@ u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
 		pio_mode = ide_scan_pio_blacklist((char *)&id[ATA_ID_PROD]);
 
 	if (pio_mode != -1) {
-		printk(KERN_INFO "%s: is on PIO blacklist\n", drive->name);
+		dev_info(&drive->gendev, "is on PIO blacklist\n");
 	} else {
 		pio_mode = id[ATA_ID_OLD_PIO_MODES] >> 8;
 		if (pio_mode > 2) {	/* 2 is maximum allowed tPIO value */
@@ -96,8 +96,8 @@ u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode)
 		}
 
 		if (overridden)
-			printk(KERN_INFO "%s: tPIO > 2, assuming tPIO = 2\n",
-					 drive->name);
+			dev_info(&drive->gendev,
+				 "tPIO > 2, assuming tPIO = 2\n");
 	}
 
 	if (pio_mode > max_mode)
drivers/ide/ide.c +8 -12
index 92c9b90..fb2b180 100644
@@ -273,25 +273,23 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
 	int i = drive->hwif->index * MAX_DRIVES + unit;
 
 	if (ide_nodma & (1 << i)) {
-		printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name);
+		dev_info(&drive->gendev, "ide: disallowing DMA\n");
 		drive->dev_flags |= IDE_DFLAG_NODMA;
 	}
 	if (ide_noflush & (1 << i)) {
-		printk(KERN_INFO "ide: disabling flush requests for %s\n",
-				 drive->name);
+		dev_info(&drive->gendev, "ide: disabling flush requests\n");
 		drive->dev_flags |= IDE_DFLAG_NOFLUSH;
 	}
 	if (ide_noprobe & (1 << i)) {
-		printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
+		dev_info(&drive->gendev, "ide: skipping probe\n");
 		drive->dev_flags |= IDE_DFLAG_NOPROBE;
 	}
 	if (ide_nowerr & (1 << i)) {
-		printk(KERN_INFO "ide: ignoring the ATA_DF bit for %s\n",
-				 drive->name);
+		dev_info(&drive->gendev, "ide: ignoring the ATA_DF bit\n");
 		drive->bad_wstat = BAD_R_STAT;
 	}
 	if (ide_cdroms & (1 << i)) {
-		printk(KERN_INFO "ide: forcing %s as a CD-ROM\n", drive->name);
+		dev_info(&drive->gendev, "ide: forcing as a CD-ROM\n");
 		drive->dev_flags |= IDE_DFLAG_PRESENT;
 		drive->media = ide_cdrom;
 		/* an ATAPI device ignores DRDY */
@@ -302,9 +300,8 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
 		drive->head = drive->bios_head = ide_disks_chs[i].head;
 		drive->sect = drive->bios_sect = ide_disks_chs[i].sect;
 
-		printk(KERN_INFO "ide: forcing %s as a disk (%d/%d/%d)\n",
-				 drive->name,
-				 drive->cyl, drive->head, drive->sect);
+		dev_info(&drive->gendev, "ide: forcing as a disk (%d/%d/%d)\n",
+			 drive->cyl, drive->head, drive->sect);
 
 		drive->dev_flags |= IDE_DFLAG_FORCED_GEOM | IDE_DFLAG_PRESENT;
 		drive->media = ide_disk;
@@ -343,8 +340,7 @@ void ide_port_apply_params(ide_hwif_t *hwif)
 	int i;
 
 	if (ide_ignore_cable & (1 << hwif->index)) {
-		printk(KERN_INFO "ide: ignoring cable detection for %s\n",
-				 hwif->name);
+		dev_info(&hwif->gendev, "ide: ignoring cable detection\n");
 		hwif->cbl = ATA_CBL_PATA40_SHORT;
 	}
 
drivers/ide/setup-pci.c +4 -3
index 5314edf..3892351 100644
@@ -384,10 +384,11 @@ int ide_hwif_setup_dma(ide_hwif_t *hwif, const struct ide_port_info *d)
 			return -1;
 
 		if (hwif->host_flags & IDE_HFLAG_MMIO)
-			printk(KERN_INFO "    %s: MMIO-DMA\n", hwif->name);
+			dev_info(&hwif->gendev, "    MMIO-DMA\n");
 		else
-			printk(KERN_INFO "    %s: BM-DMA at 0x%04lx-0x%04lx\n",
-					 hwif->name, base, base + 7);
+			dev_info(&hwif->gendev,
+				 "    BM-DMA at 0x%04lx-0x%04lx\n",
+				 base, base + 7);
 
 		hwif->extra_base = base + (hwif->channel ? 8 : 16);
 
Signature · 1 line
1.6.3.1.10.g659a0.dirty
#2 lore raw

Re: [PATCH 1/3] drivers/ide/ide-core: Convert printk(KERN_<level> to dev_<level>

Quoted 4 lines · On Saturday 23 May 2009 09:41:13 Joe Perches wrote:

When hwif->name or drive->name is printed.

There is a single #ifdef DEBUG printk(KERN_DEBUG
that is also converted to dev_dbg.

This change is not what we would like to have there, please drop it.

Quoted 41 lines
---
 drivers/ide/ide-atapi.c     |   74 ++++++++++++++++++++++---------------------
 drivers/ide/ide-dma-sff.c   |    6 ++--
 drivers/ide/ide-dma.c       |   28 ++++++++--------
 drivers/ide/ide-eh.c        |   18 +++++-----
 drivers/ide/ide-io.c        |   18 +++-------
 drivers/ide/ide-ioctls.c    |    4 +-
 drivers/ide/ide-iops.c      |    9 ++---
 drivers/ide/ide-lib.c       |    4 +-
 drivers/ide/ide-pm.c        |    8 ++--
 drivers/ide/ide-probe.c     |   69 ++++++++++++++++++++-------------------
 drivers/ide/ide-taskfile.c  |   22 ++++++-------
 drivers/ide/ide-xfer-mode.c |    6 ++--
 drivers/ide/ide.c           |   20 +++++-------
 drivers/ide/setup-pci.c     |    7 ++--
 14 files changed, 142 insertions(+), 151 deletions(-)
drivers/ide/ide-atapi.c +6 -6
index ffa1bb8..fc5cfb6 100644
@@ -50,21 +50,21 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
 #endif
 
 	if (protocol != 2)
-		printk(KERN_ERR "%s: %s: protocol (0x%02x) is not ATAPI\n",
-			s, drive->name, protocol);
+		dev_err(&drive->gendev, "%s: protocol (0x%02x) is not ATAPI\n",
+			s, protocol);
 	else if ((drive->media == ide_floppy && device_type != 0) ||
 		 (drive->media == ide_tape && device_type != 1))
-		printk(KERN_ERR "%s: %s: invalid device type (0x%02x)\n",
-			s, drive->name, device_type);
+		dev_err(&drive->gendev, "%s: invalid device type (0x%02x)\n",
+			s, device_type);
 	else if (removable == 0)
-		printk(KERN_ERR "%s: %s: the removable flag is not set\n",
-			s, drive->name);
+		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
+			s);

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s) · line 67

Quoted 10 lines
drivers/ide/ide-atapi.c +4 -4
 	else if (drive->media == ide_floppy && drq_type == 3)
-		printk(KERN_ERR "%s: %s: sorry, DRQ type (0x%02x) not "
-			"supported\n", s, drive->name, drq_type);
+		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
+			"supported\n", s, drq_type);
 	else if (packet_size != 0)
-		printk(KERN_ERR "%s: %s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, drive->name, packet_size);
+		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
+			"bytes\n", s, packet_size);

Currently we pass driver name to this function using 's' parameter, the conversion needs to take this into account (because dev_*() helpers also print driver name). IOW 's' should be dropped now.

Quoted 4 lines
drivers/ide/ide-probe.c +0 -0
index 4002487..5672c27 100644

[...]

drivers/ide/ide-probe.c static int do_probe (ide_drive_t *drive, u8 cmd) · line 381

Quoted 11 lines
drivers/ide/ide-probe.c +4 -3
@@ -376,9 +375,10 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 		return 4;
 
 #ifdef DEBUG
-	printk(KERN_INFO "probing for %s: present=%d, media=%d, probetype=%s\n",
-		drive->name, present, drive->media,
-		(cmd == ATA_CMD_ID_ATA) ? "ATA" : "ATAPI");
+	dev_info(&drive->gendev,
+		 "probing for %s: present=%d, media=%d, probetype=%s\n",
+		 drive->name, present, drive->media,
+		 (cmd == ATA_CMD_ID_ATA) ? "ATA" : "ATAPI");

drive->name should be dropped now

Quoted 46 lines
drivers/ide/ide.c +7 -10
@@ -273,25 +273,23 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
 	int i = drive->hwif->index * MAX_DRIVES + unit;
 
 	if (ide_nodma & (1 << i)) {
-		printk(KERN_INFO "ide: disallowing DMA for %s\n", drive->name);
+		dev_info(&drive->gendev, "ide: disallowing DMA\n");
 		drive->dev_flags |= IDE_DFLAG_NODMA;
 	}
 	if (ide_noflush & (1 << i)) {
-		printk(KERN_INFO "ide: disabling flush requests for %s\n",
-				 drive->name);
+		dev_info(&drive->gendev, "ide: disabling flush requests\n");
 		drive->dev_flags |= IDE_DFLAG_NOFLUSH;
 	}
 	if (ide_noprobe & (1 << i)) {
-		printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
+		dev_info(&drive->gendev, "ide: skipping probe\n");
 		drive->dev_flags |= IDE_DFLAG_NOPROBE;
 	}
 	if (ide_nowerr & (1 << i)) {
-		printk(KERN_INFO "ide: ignoring the ATA_DF bit for %s\n",
-				 drive->name);
+		dev_info(&drive->gendev, "ide: ignoring the ATA_DF bit\n");
 		drive->bad_wstat = BAD_R_STAT;
 	}
 	if (ide_cdroms & (1 << i)) {
-		printk(KERN_INFO "ide: forcing %s as a CD-ROM\n", drive->name);
+		dev_info(&drive->gendev, "ide: forcing as a CD-ROM\n");
 		drive->dev_flags |= IDE_DFLAG_PRESENT;
 		drive->media = ide_cdrom;
 		/* an ATAPI device ignores DRDY */
@@ -302,9 +300,8 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
 		drive->head = drive->bios_head = ide_disks_chs[i].head;
 		drive->sect = drive->bios_sect = ide_disks_chs[i].sect;
 
-		printk(KERN_INFO "ide: forcing %s as a disk (%d/%d/%d)\n",
-				 drive->name,
-				 drive->cyl, drive->head, drive->sect);
+		dev_info(&drive->gendev, "ide: forcing as a disk (%d/%d/%d)\n",
+			 drive->cyl, drive->head, drive->sect);
 
 		drive->dev_flags |= IDE_DFLAG_FORCED_GEOM | IDE_DFLAG_PRESENT;
 		drive->media = ide_disk;

drivers/ide/ide.c void ide_port_apply_params(ide_hwif_t *hwif) · line 345

Quoted 8 lines
drivers/ide/ide.c +1 -2
@@ -343,8 +340,7 @@ void ide_port_apply_params(ide_hwif_t *hwif)
 	int i;
 
 	if (ide_ignore_cable & (1 << hwif->index)) {
-		printk(KERN_INFO "ide: ignoring cable detection for %s\n",
-				 hwif->name);
+		dev_info(&hwif->gendev, "ide: ignoring cable detection\n");
 		hwif->cbl = ATA_CBL_PATA40_SHORT;
 	}

Probably "ide: " should be dropped now in all the above dev_*() instances.

also:

Please test your patches -- I get following output with this patch:

Uniform Multi-Platform E-IDE driver
piix 0000:00:1f.1: IDE controller (0x8086:0x24ca rev 0x03)
pci 0000:00:1f.1: enabling device (0005 -> 0007)
pci 0000:00:1f.1: PCI INT A -> Link[LNKC] -> GSI 10 (level, low) -> IRQ 10 piix 0000:00:1f.1: not 100% native mode: will probe irqs later
<NULL>: BM-DMA at 0x1100-0x1107
<NULL>: BM-DMA at 0x1108-0x110f
Probing IDE interface ide0...
<NULL>: IC25N060ATMR04-0, ATA DISK drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
<NULL>: UDMA/100 mode selected
Probing IDE interface ide1...
<NULL>: TOSHIBA ODD-DVD SD-R6372, ATAPI CD/DVD-ROM drive
hdc: host max PIO4 wanted PIO255(auto-tune) selected PIO4
<NULL>: UDMA/33 mode selected
ide0: at 0x1f0-0x1f7,0x3f6 on irq 14
ide1: at 0x170-0x177,0x376 on irq 15

It turns out that some drive->name users should be converted to use hwif->name instead (which means they would be using hwif->gendev instead of drive->gendev after conversion) and also some hwif->name users should become pci_dev->name users.

It looks that it is not as simple as a mindless s/printk()/dev_*()/g conversion (sorry for being too optimistic about it previously).

[ OTOH this is the standard practice in kernel development process that
if we discover underlying issues we address them first and quite often the end result is very different from the initial patches. ]

Another observation from the testing is:

ide-cd: hdc: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache

this message comes from ATAPI layer but since device drivers haven't been converted yet they would be preceded by only "hdc: " so we need to apply all dev_*() conversion patches in one go to keep the consistency of kernel messages and not confuse users (BTW when are the other patches coming?).

Once again sorry if this sounds like more work than we initially though but the IDE logging improvements are much needed and I think that once we are content with the way of doing dev_*()/pr_*() conversion the similar approach can be later used also in other kernel subsystems.

Thanks.
Bart

#3 lore raw

PATCH 2/3 drivers/ide/ide-core: Convert printk(KERN_<level> to pr_<level>

In reply to Joe Perches
---
 drivers/ide/ide-acpi.c     |   18 +++++------
 drivers/ide/ide-atapi.c    |    6 ++--
 drivers/ide/ide-eh.c       |    8 ++--
 drivers/ide/ide-legacy.c   |    8 ++--
 drivers/ide/ide-lib.c      |   64 ++++++++++++++++++------------------
 drivers/ide/ide-probe.c    |   36 ++++++++++----------
 drivers/ide/ide-proc.c     |   17 +++++-----
 drivers/ide/ide-scan-pci.c |    4 +-
 drivers/ide/ide.c          |    4 +-
 drivers/ide/setup-pci.c    |   76 ++++++++++++++++++++++----------------------
 10 files changed, 119 insertions(+), 122 deletions(-)
drivers/ide/ide-acpi.c +8 -10
index 77f79d2..f323a60 100644
@@ -67,7 +67,7 @@ static bool ide_noacpi_psx;
 static int no_acpi_psx(const struct dmi_system_id *id)
 {
 	ide_noacpi_psx = true;
-	printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident);
+	pr_notice("%s detected - disable ACPI _PSx.\n", id->ident);
 	return 0;
 }
 
@@ -262,8 +262,7 @@ static int do_drive_get_GTF(ide_drive_t *drive,
 
 	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
 	    out_obj->buffer.length % REGS_PER_GTF) {
-		printk(KERN_ERR
-		       "%s: unexpected GTF length (%d) or addr (0x%p)\n",
+		pr_err("%s: unexpected GTF length (%d) or addr (0x%p)\n",
 		       __func__, out_obj->buffer.length,
 		       out_obj->buffer.pointer);
 		err = -ENOENT;
@@ -324,8 +323,8 @@ static int do_drive_set_taskfiles(ide_drive_t *drive,
 
 		err = ide_no_data_taskfile(drive, &cmd);
 		if (err) {
-			printk(KERN_ERR "%s: ide_no_data_taskfile failed: %u\n",
-					__func__, err);
+			pr_err("%s: ide_no_data_taskfile failed: %u\n",
+			       __func__, err);
 			rc = err;
 		}
 	}
@@ -436,11 +435,10 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
 	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
 	    out_obj->buffer.length != sizeof(struct GTM_buffer)) {
 		kfree(output.pointer);
-		printk(KERN_ERR
-			"%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
-			"addr (0x%p)\n",
-			__func__, out_obj->buffer.length,
-			sizeof(struct GTM_buffer), out_obj->buffer.pointer);
+		pr_err("%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
+		       "addr (0x%p)\n",
+		       __func__, out_obj->buffer.length,
+		       sizeof(struct GTM_buffer), out_obj->buffer.pointer);
 		return;
 	}
 
drivers/ide/ide-atapi.c +3 -3
index fc5cfb6..46cf46e 100644
@@ -12,7 +12,7 @@
 
 #ifdef DEBUG
 #define debug_log(fmt, args...) \
-	printk(KERN_INFO "ide: " fmt, ## args)
+	pr_info("ide: " fmt, ## args)
 #else
 #define debug_log(fmt, args...) do {} while (0)
 #endif
@@ -297,8 +297,8 @@ int ide_cd_expiry(ide_drive_t *drive)
 		break;
 	default:
 		if (!(rq->cmd_flags & REQ_QUIET))
-			printk(KERN_INFO "cmd 0x%x timed out\n",
-					 rq->cmd[0]);
+			pr_info("cmd 0x%x timed out\n",
+				rq->cmd[0]);
 		wait = 0;
 		break;
 	}
drivers/ide/ide-eh.c +4 -4
index 75019ce..b1d8b85 100644
@@ -204,12 +204,12 @@ static void ide_reset_report_error(ide_hwif_t *hwif, u8 err)
 
 	dev_err(&hwif->gendev, "reset: master: ");
 	if (err_master && err_master < 6)
-		printk(KERN_CONT "%s", err_master_vals[err_master]);
+		pr_cont("%s", err_master_vals[err_master]);
 	else
-		printk(KERN_CONT "error (0x%02x?)", err);
+		pr_cont("error (0x%02x?)", err);
 	if (err & 0x80)
-		printk(KERN_CONT "; slave: failed");
-	printk(KERN_CONT "\n");
+		pr_cont("; slave: failed");
+	pr_cont("\n");
 }
 
 /*
drivers/ide/ide-legacy.c +4 -4
index b9654a7..2979b4e 100644
@@ -19,14 +19,14 @@ static void ide_legacy_init_one(struct ide_hw **hws, struct ide_hw *hw,
 	}
 
 	if (!request_region(base, 8, d->name)) {
-		printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
-				d->name, base, base + 7);
+		pr_err("%s: I/O resource 0x%lX-0x%lX not free.\n",
+		       d->name, base, base + 7);
 		return;
 	}
 
 	if (!request_region(ctl, 1, d->name)) {
-		printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
-				d->name, ctl);
+		pr_err("%s: I/O resource 0x%lX not free.\n",
+		       d->name, ctl);
 		release_region(base, 8);
 		return;
 	}
drivers/ide/ide-lib.c +32 -32

124 lines not on this page · raw message

drivers/ide/ide-probe.c +18 -18
index 5672c27..c4b44e2 100644
@@ -133,9 +133,9 @@ static void ide_classify_atapi_dev(ide_drive_t *drive)
 			if (!strstr(m, "oppy") &&
 			    !strstr(m, "poyp") &&
 			    !strstr(m, "ZIP"))
-				printk(KERN_CONT "cdrom or floppy?, assuming ");
+				pr_cont("cdrom or floppy?, assuming ");
 			if (drive->media != ide_cdrom) {
-				printk(KERN_CONT "FLOPPY");
+				pr_cont("FLOPPY");
 				drive->dev_flags |= IDE_DFLAG_REMOVABLE;
 				break;
 			}
@@ -147,26 +147,26 @@ static void ide_classify_atapi_dev(ide_drive_t *drive)
 #ifdef CONFIG_PPC
 		/* kludge for Apple PowerBook internal zip */
 		if (!strstr(m, "CD-ROM") && strstr(m, "ZIP")) {
-			printk(KERN_CONT "FLOPPY");
+			pr_cont("FLOPPY");
 			type = ide_floppy;
 			break;
 		}
 #endif
-		printk(KERN_CONT "CD/DVD-ROM");
+		pr_cont("CD/DVD-ROM");
 		break;
 	case ide_tape:
-		printk(KERN_CONT "TAPE");
+		pr_cont("TAPE");
 		break;
 	case ide_optical:
-		printk(KERN_CONT "OPTICAL");
+		pr_cont("OPTICAL");
 		drive->dev_flags |= IDE_DFLAG_REMOVABLE;
 		break;
 	default:
-		printk(KERN_CONT "UNKNOWN (type %d)", type);
+		pr_cont("UNKNOWN (type %d)", type);
 		break;
 	}
 
-	printk(KERN_CONT " drive\n");
+	pr_cont(" drive\n");
 	drive->media = type;
 	/* an ATAPI device ignores DRDY */
 	drive->ready_stat = 0;
@@ -476,7 +476,7 @@ static u8 probe_for_drive(ide_drive_t *drive)
 
 	drive->id = kzalloc(SECTOR_SIZE, GFP_KERNEL);
 	if (drive->id == NULL) {
-		printk(KERN_ERR "ide: out of memory for id data.\n");
+		pr_err("ide: out of memory for id data.\n");
 		return 0;
 	}
 
@@ -559,8 +559,8 @@ static int ide_register_port(ide_hwif_t *hwif)
 
 	ret = device_register(&hwif->gendev);
 	if (ret < 0) {
-		printk(KERN_WARNING "IDE: %s: device_register error: %d\n",
-			__func__, ret);
+		pr_warning("IDE: %s: device_register error: %d\n",
+			   __func__, ret);
 		goto out;
 	}
 
@@ -674,7 +674,7 @@ void ide_undecoded_slave(ide_drive_t *dev1)
 		return;
 
 	/* Appears to be an IDE flash adapter with decode bugs */
-	printk(KERN_WARNING "ide-probe: ignoring undecoded slave\n");
+	pr_warning("ide-probe: ignoring undecoded slave\n");
 
 	dev1->dev_flags &= ~IDE_DFLAG_PRESENT;
 }
@@ -856,8 +856,8 @@ static int init_irq (ide_hwif_t *hwif)
 		 io_ports->data_addr, hwif->irq);
 #endif /* __mc68000__ */
 	if (hwif->host->host_flags & IDE_HFLAG_SERIALIZE)
-		printk(KERN_CONT " (serialized)");
-	printk(KERN_CONT "\n");
+		pr_cont(" (serialized)");
+	pr_cont("\n");
 
 	return 0;
 out_up:
@@ -1007,8 +1007,8 @@ static void hwif_register_devices(ide_hwif_t *hwif)
 
 		ret = device_register(dev);
 		if (ret < 0)
-			printk(KERN_WARNING "IDE: %s: device_register error: "
-					    "%d\n", __func__, ret);
+			pr_warning("IDE: %s: device_register error: "
+				   "%d\n", __func__, ret);
 	}
 }
 
@@ -1292,8 +1292,8 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d,
 
 		idx = ide_find_port_slot(d);
 		if (idx < 0) {
-			printk(KERN_ERR "%s: no free slot for interface\n",
-					d ? d->name : "ide");
+			pr_err("%s: no free slot for interface\n",
+			       d ? d->name : "ide");
 			kfree(hwif);
 			continue;
 		}
drivers/ide/ide-proc.c +8 -9
index 3242698..23b9d6a 100644
@@ -241,8 +241,8 @@ static void proc_ide_settings_warn(void)
 	if (warned)
 		return;
 
-	printk(KERN_WARNING "Warning: /proc/ide/hd?/settings interface is "
-			    "obsolete, and will be removed soon!\n");
+	pr_warning("Warning: /proc/ide/hd?/settings interface is "
+		   "obsolete, and will be removed soon!\n");
 	warned = 1;
 }
 
@@ -464,15 +464,14 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
 	strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
 	err = device_attach(dev);
 	if (err < 0)
-		printk(KERN_WARNING "IDE: %s: device_attach error: %d\n",
-			__func__, err);
+		pr_warning("IDE: %s: device_attach error: %d\n",
+			   __func__, err);
 	drive->driver_req[0] = 0;
 	if (dev->driver == NULL) {
 		err = device_attach(dev);
 		if (err < 0)
-			printk(KERN_WARNING
-				"IDE: %s: device_attach(2) error: %d\n",
-				__func__, err);
+			pr_warning("IDE: %s: device_attach(2) error: %d\n",
+				   __func__, err);
 	}
 	if (dev->driver && !strcmp(dev->driver->name, driver))
 		ret = 0;
@@ -666,8 +665,8 @@ static int ide_drivers_show(struct seq_file *s, void *p)
 
 	err = bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
 	if (err < 0)
-		printk(KERN_WARNING "IDE: %s: bus_for_each_drv error: %d\n",
-			__func__, err);
+		pr_warning("IDE: %s: bus_for_each_drv error: %d\n",
+			   __func__, err);
 	return 0;
 }
 
drivers/ide/ide-scan-pci.c +2 -2
index 0e79eff..84e791a 100644
@@ -101,8 +101,8 @@ static int __init ide_scan_pcibus(void)
 		d = list_entry(l, struct pci_driver, node);
 		if (__pci_register_driver(d, d->driver.owner,
 					  d->driver.mod_name))
-			printk(KERN_ERR "%s: failed to register %s driver\n",
-					__func__, d->driver.mod_name);
+			pr_err("%s: failed to register %s driver\n",
+			       __func__, d->driver.mod_name);
 	}
 
 	return 0;
drivers/ide/ide.c +2 -2
index fb2b180..ab8ffcf 100644
@@ -355,11 +355,11 @@ static int __init ide_init(void)
 {
 	int ret;
 
-	printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
+	pr_info("Uniform Multi-Platform E-IDE driver\n");
 
 	ret = bus_register(&ide_bus_type);
 	if (ret < 0) {
-		printk(KERN_WARNING "IDE: bus_register error: %d\n", ret);
+		pr_warning("IDE: bus_register error: %d\n", ret);
 		return ret;
 	}
 
drivers/ide/setup-pci.c +38 -38

192 lines not on this page · raw message

Signature · 1 line
1.6.3.1.10.g659a0.dirty
#4 lore raw

Re: [PATCH 2/3] drivers/ide/ide-core: Convert printk(KERN_<level> to pr_<level>

Quoted 198 lines · On Saturday 23 May 2009 09:41:14 Joe Perches wrote:
drivers/ide/setup-pci.c +35 -35
@@ -39,18 +39,18 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)
 	if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 			 (progif & 5) != 5) {
 		if ((progif & 0xa) != 0xa) {
-			printk(KERN_INFO "%s %s: device not capable of full "
+			pr_info("%s %s: device not capable of full "
 				"native PCI mode\n", name, pci_name(dev));
 			return -EOPNOTSUPP;
 		}
-		printk(KERN_INFO "%s %s: placing both ports into native PCI "
+		pr_info("%s %s: placing both ports into native PCI "
 			"mode\n", name, pci_name(dev));
 		(void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
 		if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 		    (progif & 5) != 5) {
-			printk(KERN_ERR "%s %s: rewrite of PROGIF failed, "
-				"wanted 0x%04x, got 0x%04x\n",
-				name, pci_name(dev), progif | 5, progif);
+			pr_err("%s %s: rewrite of PROGIF failed, "
+			       "wanted 0x%04x, got 0x%04x\n",
+			       name, pci_name(dev), progif | 5, progif);
 			return -EOPNOTSUPP;
 		}
 	}
@@ -92,8 +92,8 @@ unsigned long ide_pci_dma_base(ide_hwif_t *hwif, const struct ide_port_info *d)
 		dma_base = pci_resource_start(dev, baridx);
 
 		if (dma_base == 0) {
-			printk(KERN_ERR "%s %s: DMA base is invalid\n",
-				d->name, pci_name(dev));
+			pr_err("%s %s: DMA base is invalid\n",
+			       d->name, pci_name(dev));
 			return 0;
 		}
 	}
@@ -115,7 +115,7 @@ int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d)
 
 	if (d->host_flags & IDE_HFLAG_CLEAR_SIMPLEX) {
 		if (ide_pci_clear_simplex(hwif->dma_base, d->name))
-			printk(KERN_INFO "%s %s: simplex device: DMA forced\n",
+			pr_info("%s %s: simplex device: DMA forced\n",
 				d->name, pci_name(dev));
 		goto out;
 	}
@@ -132,7 +132,7 @@ int ide_pci_check_simplex(ide_hwif_t *hwif, const struct ide_port_info *d)
 	 */
 	dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 	if ((dma_stat & 0x80) && hwif->mate && hwif->mate->dma_base) {
-		printk(KERN_INFO "%s %s: simplex device: DMA disabled\n",
+		pr_info("%s %s: simplex device: DMA disabled\n",
 			d->name, pci_name(dev));
 		return -1;
 	}
@@ -155,8 +155,8 @@ int ide_pci_set_master(struct pci_dev *dev, const char *name)
 
 		if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) ||
 		    (pcicmd & PCI_COMMAND_MASTER) == 0) {
-			printk(KERN_ERR "%s %s: error updating PCICMD\n",
-				name, pci_name(dev));
+			pr_err("%s %s: error updating PCICMD\n",
+			       name, pci_name(dev));
 			return -EIO;
 		}
 	}
@@ -168,7 +168,7 @@ EXPORT_SYMBOL_GPL(ide_pci_set_master);
 
 void ide_setup_pci_noise(struct pci_dev *dev, const struct ide_port_info *d)
 {
-	printk(KERN_INFO "%s %s: IDE controller (0x%04x:0x%04x rev 0x%02x)\n",
+	pr_info("%s %s: IDE controller (0x%04x:0x%04x rev 0x%02x)\n",
 		d->name, pci_name(dev),
 		dev->vendor, dev->device, dev->revision);
 }
@@ -195,12 +195,12 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
 	if (pci_enable_device(dev)) {
 		ret = pci_enable_device_io(dev);
 		if (ret < 0) {
-			printk(KERN_WARNING "%s %s: couldn't enable device\n",
-				d->name, pci_name(dev));
+			pr_warning("%s %s: couldn't enable device\n",
+				   d->name, pci_name(dev));
 			goto out;
 		}
-		printk(KERN_WARNING "%s %s: BIOS configuration fixed\n",
-			d->name, pci_name(dev));
+		pr_warning("%s %s: BIOS configuration fixed\n",
+			   d->name, pci_name(dev));
 	}
 
 	/*
@@ -210,8 +210,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
 	 */
 	ret = pci_set_dma_mask(dev, DMA_BIT_MASK(32));
 	if (ret < 0) {
-		printk(KERN_ERR "%s %s: can't set DMA mask\n",
-			d->name, pci_name(dev));
+		pr_err("%s %s: can't set DMA mask\n",
+		       d->name, pci_name(dev));
 		goto out;
 	}
 
@@ -229,8 +229,8 @@ static int ide_pci_enable(struct pci_dev *dev, const struct ide_port_info *d)
 
 	ret = pci_request_selected_regions(dev, bars, d->name);
 	if (ret < 0)
-		printk(KERN_ERR "%s %s: can't reserve resources\n",
-			d->name, pci_name(dev));
+		pr_err("%s %s: can't reserve resources\n",
+		       d->name, pci_name(dev));
 out:
 	return ret;
 }
@@ -256,18 +256,18 @@ static int ide_pci_configure(struct pci_dev *dev, const struct ide_port_info *d)
 	 */
 	if (ide_setup_pci_baseregs(dev, d->name) ||
 	    pci_write_config_word(dev, PCI_COMMAND, pcicmd | PCI_COMMAND_IO)) {
-		printk(KERN_INFO "%s %s: device disabled (BIOS)\n",
+		pr_info("%s %s: device disabled (BIOS)\n",
 			d->name, pci_name(dev));
 		return -ENODEV;
 	}
 	if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) {
-		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
-			d->name, pci_name(dev));
+		pr_err("%s %s: error accessing PCI regs\n",
+		       d->name, pci_name(dev));
 		return -EIO;
 	}
 	if (!(pcicmd & PCI_COMMAND_IO)) {
-		printk(KERN_ERR "%s %s: unable to enable IDE controller\n",
-			d->name, pci_name(dev));
+		pr_err("%s %s: unable to enable IDE controller\n",
+		       d->name, pci_name(dev));
 		return -ENXIO;
 	}
 	return 0;
@@ -322,9 +322,9 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
 	if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
 		if (ide_pci_check_iomem(dev, d, 2 * port) ||
 		    ide_pci_check_iomem(dev, d, 2 * port + 1)) {
-			printk(KERN_ERR "%s %s: I/O baseregs (BIOS) are "
-				"reported as MEM for port %d!\n",
-				d->name, pci_name(dev), port);
+			pr_err("%s %s: I/O baseregs (BIOS) are "
+			       "reported as MEM for port %d!\n",
+			       d->name, pci_name(dev), port);
 			return -EINVAL;
 		}
 
@@ -337,8 +337,8 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
 	}
 
 	if (!base || !ctl) {
-		printk(KERN_ERR "%s %s: bad PCI BARs for port %d, skipping\n",
-			d->name, pci_name(dev), port);
+		pr_err("%s %s: bad PCI BARs for port %d, skipping\n",
+		       d->name, pci_name(dev), port);
 		return -EINVAL;
 	}
 
@@ -426,15 +426,15 @@ static int ide_setup_pci_controller(struct pci_dev *dev,
 
 	ret = pci_read_config_word(dev, PCI_COMMAND, &pcicmd);
 	if (ret < 0) {
-		printk(KERN_ERR "%s %s: error accessing PCI regs\n",
-			d->name, pci_name(dev));
+		pr_err("%s %s: error accessing PCI regs\n",
+		       d->name, pci_name(dev));
 		goto out;
 	}
 	if (!(pcicmd & PCI_COMMAND_IO)) {	/* is device disabled? */
 		ret = ide_pci_configure(dev, d);
 		if (ret < 0)
 			goto out;
-		printk(KERN_INFO "%s %s: device enabled (Linux)\n",
+		pr_info("%s %s: device enabled (Linux)\n",
 			d->name, pci_name(dev));
 	}
 
@@ -473,7 +473,7 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct ide_port_info *d,
 
 		if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) ||
 		    (tmp & e->mask) != e->val)) {
-			printk(KERN_INFO "%s %s: IDE port disabled\n",
+			pr_info("%s %s: IDE port disabled\n",
 				d->name, pci_name(dev));
 			continue;	/* port not enabled */
 		}
@@ -519,14 +519,14 @@ static int do_ide_setup_pci_device(struct pci_dev *dev,
 
 	if (ide_pci_is_in_compatibility_mode(dev)) {
 		if (noisy)
-			printk(KERN_INFO "%s %s: not 100%% native mode: will "
+			pr_info("%s %s: not 100%% native mode: will "
 				"probe irqs later\n", d->name, pci_name(dev));
 		pciirq = 0;

drivers/ide/setup-pci.c static int do_ide_setup_pci_device(struct pci_dev *dev, · line 531

Quoted 10 lines
drivers/ide/setup-pci.c +3 -3
 	} else if (!pciirq && noisy) {
-		printk(KERN_WARNING "%s %s: bad irq (%d): will probe later\n",
-			d->name, pci_name(dev), pciirq);
+		pr_warning("%s %s: bad irq (%d): will probe later\n",
+			   d->name, pci_name(dev), pciirq);
 	} else if (noisy) {
-		printk(KERN_INFO "%s %s: 100%% native mode on irq %d\n",
+		pr_info("%s %s: 100%% native mode on irq %d\n",
 			d->name, pci_name(dev), pciirq);
 	}

Seems like it would be more beneficial to convert the above printk()s to use dev_*(&dev->dev) instead (please note the "%s %s: " prefix).

#5 lore raw

PATCH 3/3 drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

In reply to Joe Perches
---
 drivers/ide/ide-acpi.c     |    4 ++--
 drivers/ide/ide-atapi.c    |   28 ++++++++++++----------------
 drivers/ide/ide-io.c       |    5 +++--
 drivers/ide/ide-iops.c     |    4 ++--
 drivers/ide/ide-legacy.c   |    3 +--
 drivers/ide/ide-probe.c    |   13 +++++++------
 drivers/ide/ide-proc.c     |    3 +--
 drivers/ide/ide-taskfile.c |    9 +++++----
 drivers/ide/setup-pci.c    |   22 ++++++++++++----------
 9 files changed, 45 insertions(+), 46 deletions(-)
drivers/ide/ide-acpi.c +2 -2
index f323a60..560b9c4 100644
@@ -435,8 +435,8 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
 	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
 	    out_obj->buffer.length != sizeof(struct GTM_buffer)) {
 		kfree(output.pointer);
-		pr_err("%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
-		       "addr (0x%p)\n",
+		pr_err(
+	"%s: unexpected _GTM length (0x%x)[should be 0x%zx] or addr (0x%p)\n",
 		       __func__, out_obj->buffer.length,
 		       sizeof(struct GTM_buffer), out_obj->buffer.pointer);
 		return;
drivers/ide/ide-atapi.c +12 -16
index 46cf46e..1e9e2d6 100644
@@ -60,11 +60,13 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
 		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
 			s);
 	else if (drive->media == ide_floppy && drq_type == 3)
-		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
-			"supported\n", s, drq_type);
+		dev_err(&drive->gendev,
+			"%s: sorry, DRQ type (0x%02x) not supported\n",
+			s, drq_type);
 	else if (packet_size != 0)
-		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, packet_size);
+		dev_err(&drive->gendev,
+			"%s: packet size (0x%02x) is not 12 bytes\n",
+			s, packet_size);
 	else
 		return 1;
 	return 0;
@@ -297,8 +299,7 @@ int ide_cd_expiry(ide_drive_t *drive)
 		break;
 	default:
 		if (!(rq->cmd_flags & REQ_QUIET))
-			pr_info("cmd 0x%x timed out\n",
-				rq->cmd[0]);
+			pr_info("cmd 0x%x timed out\n", rq->cmd[0]);
 		wait = 0;
 		break;
 	}
@@ -439,8 +440,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
 		dev_err(&drive->gendev,
-			"The device wants to issue more interrupts "
-			"in DMA mode\n");
+	"The device wants to issue more interrupts in DMA mode\n");
 		ide_dma_off(drive);
 		return ide_do_reset(drive);
 	}
@@ -509,14 +509,12 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
 	while (retries-- && ((ireason & ATAPI_COD) == 0 ||
 			     (ireason & ATAPI_IO))) {
 		dev_err(&drive->gendev,
-			"(IO,CoD != (0,1) while issuing "
-			"a packet command, retrying\n");
+	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");
 		udelay(100);
 		ireason = ide_read_ireason(drive);
 		if (retries == 0) {
 			dev_err(&drive->gendev,
-				"(IO,CoD != (0,1) while issuing "
-				"a packet command, ignoring\n");
+	"(IO,CoD != (0,1) while issuing a packet command, ignoring\n");
 			ireason |= ATAPI_COD;
 			ireason &= ~ATAPI_IO;
 		}
@@ -547,8 +545,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
 		dev_err(&drive->gendev,
-			"Strange, packet command initiated yet "
-			"DRQ isn't asserted\n");
+	"Strange, packet command initiated yet DRQ isn't asserted\n");
 		return startstop;
 	}
 
@@ -590,8 +587,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 		if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
 			dev_err(&drive->gendev,
-				"(IO,CoD) != (0,1) while issuing "
-				"a packet command\n");
+		"(IO,CoD) != (0,1) while issuing a packet command\n");
 
 			return ide_do_reset(drive);
 		}
drivers/ide/ide-io.c +3 -2
index 51c7cb4..07565c9 100644
@@ -743,8 +743,9 @@ static void unexpected_intr(int irq, ide_hwif_t *hwif)
 
 		if (time_after(jiffies, last_msgtime + HZ)) {
 			last_msgtime = jiffies;
-			dev_err(&hwif->gendev, "unexpected interrupt, "
-				"status=0x%02x, count=%ld\n", stat, count);
+			dev_err(&hwif->gendev,
+		"unexpected interrupt, status=0x%02x, count=%ld\n",
+				stat, count);
 		}
 	}
 }
drivers/ide/ide-iops.c +2 -2
index 6dbb96e..c5ab2ec 100644
@@ -259,8 +259,8 @@ no_80w:
 	if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
 		return 0;
 
-	dev_warn(&drive->gendev, "%s side 80-wire cable detection failed, "
-		 "limiting max speed to UDMA33\n",
+	dev_warn(&drive->gendev,
+ "%s side 80-wire cable detection failed, limiting max speed to UDMA33\n",
 		 hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");
 
 	drive->dev_flags |= IDE_DFLAG_UDMA33_WARNED;
drivers/ide/ide-legacy.c +1 -2
index 2979b4e..317ab1b 100644
@@ -25,8 +25,7 @@ static void ide_legacy_init_one(struct ide_hw **hws, struct ide_hw *hw,
 	}
 
 	if (!request_region(ctl, 1, d->name)) {
-		pr_err("%s: I/O resource 0x%lX not free.\n",
-		       d->name, ctl);
+		pr_err("%s: I/O resource 0x%lX not free.\n", d->name, ctl);
 		release_region(base, 8);
 		return;
 	}
drivers/ide/ide-probe.c +7 -6
index c4b44e2..a4120e2 100644
@@ -271,8 +271,9 @@ int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id)
 		s = tp_ops->read_status(hwif);
 		if ((a ^ s) & ~ATA_IDX)
 			/* ancient Seagate drives, broken interfaces */
-			dev_info(&drive->gendev, "probing with STATUS(0x%02x) "
-				 "instead of ALTSTATUS(0x%02x)\n", s, a);
+			dev_info(&drive->gendev,
+		 "probing with STATUS(0x%02x) instead of ALTSTATUS(0x%02x)\n",
+				 s, a);
 		else
 			/* use non-intrusive polling */
 			use_altstatus = 1;
@@ -415,8 +416,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 
 		if (rc == 1 && cmd == ATA_CMD_ID_ATAPI) {
 			dev_err(&drive->gendev,
-				"no response (status = 0x%02x), "
-				"resetting drive\n", stat);
+		"no response (status = 0x%02x), resetting drive\n",
+				stat);
 			msleep(50);
 			tp_ops->dev_select(drive);
 			msleep(50);
@@ -1007,8 +1008,8 @@ static void hwif_register_devices(ide_hwif_t *hwif)
 
 		ret = device_register(dev);
 		if (ret < 0)
-			pr_warning("IDE: %s: device_register error: "
-				   "%d\n", __func__, ret);
+			pr_warning("IDE: %s: device_register error: %d\n",
+				   __func__, ret);
 	}
 }
 
drivers/ide/ide-proc.c +1 -2
index 23b9d6a..cd580b1 100644
@@ -464,8 +464,7 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
 	strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
 	err = device_attach(dev);
 	if (err < 0)
-		pr_warning("IDE: %s: device_attach error: %d\n",
-			   __func__, err);
+		pr_warning("IDE: %s: device_attach error: %d\n", __func__, err);
 	drive->driver_req[0] = 0;
 	if (dev->driver == NULL) {
 		err = device_attach(dev);
drivers/ide/ide-taskfile.c +5 -4
index 8d741d1..687b3be 100644
@@ -579,8 +579,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 		case TASKFILE_MULTI_OUT:
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
-				dev_err(&drive->gendev, "%s Multimode Write " \
-					"multcount is not set\n", __func__);
+				dev_err(&drive->gendev,
+			"%s Multimode Write multcount is not set\n",
+					__func__);
 				err = -EPERM;
 				goto abort;
 			}
@@ -599,8 +600,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
 				dev_err(&drive->gendev,
-					"%s Multimode Read failure "
-					"multcount is not set\n", __func__);
+			"%s Multimode Read failure multcount is not set\n",
+					__func__);
 				err = -EPERM;
 				goto abort;
 			}
drivers/ide/setup-pci.c +12 -10
index f139cf3..3aca89a 100644
@@ -39,17 +39,18 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)
 	if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 			 (progif & 5) != 5) {
 		if ((progif & 0xa) != 0xa) {
-			pr_info("%s %s: device not capable of full "
-				"native PCI mode\n", name, pci_name(dev));
+			pr_info(
+		"%s %s: device not capable of full native PCI mode\n",
+				name, pci_name(dev));
 			return -EOPNOTSUPP;
 		}
-		pr_info("%s %s: placing both ports into native PCI "
-			"mode\n", name, pci_name(dev));
+		pr_info("%s %s: placing both ports into native PCI mode\n",
+			name, pci_name(dev));
 		(void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
 		if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 		    (progif & 5) != 5) {
-			pr_err("%s %s: rewrite of PROGIF failed, "
-			       "wanted 0x%04x, got 0x%04x\n",
+			pr_err(
+		"%s %s: rewrite of PROGIF failed, wanted 0x%04x, got 0x%04x\n",
 			       name, pci_name(dev), progif | 5, progif);
 			return -EOPNOTSUPP;
 		}
@@ -322,8 +323,8 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
 	if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
 		if (ide_pci_check_iomem(dev, d, 2 * port) ||
 		    ide_pci_check_iomem(dev, d, 2 * port + 1)) {
-			pr_err("%s %s: I/O baseregs (BIOS) are "
-			       "reported as MEM for port %d!\n",
+			pr_err(
+		"%s %s: I/O baseregs (BIOS) are reported as MEM for port %d!\n",
 			       d->name, pci_name(dev), port);
 			return -EINVAL;
 		}
@@ -519,8 +520,9 @@ static int do_ide_setup_pci_device(struct pci_dev *dev,
 
 	if (ide_pci_is_in_compatibility_mode(dev)) {
 		if (noisy)
-			pr_info("%s %s: not 100%% native mode: will "
-				"probe irqs later\n", d->name, pci_name(dev));
+			pr_info(
+		"%s %s: not 100%% native mode: will probe irqs later\n",
+				d->name, pci_name(dev));
 		pciirq = 0;
 	} else if (!pciirq && noisy) {
 		pr_warning("%s %s: bad irq (%d): will probe later\n",
Signature · 1 line
1.6.3.1.10.g659a0.dirty
#6 lore raw

Re: [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

Hello.

Quoted 2 lines · Joe Perches

[...]

drivers/ide/ide-acpi.c void ide_acpi_get_timing(ide_hwif_t *hwif) · line 440

Quoted 13 lines
drivers/ide/ide-acpi.c +2 -2
index f323a60..560b9c4 100644
@@ -435,8 +435,8 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
 	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
 	    out_obj->buffer.length != sizeof(struct GTM_buffer)) {
 		kfree(output.pointer);
-		pr_err("%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
-		       "addr (0x%p)\n",
+		pr_err(
+	"%s: unexpected _GTM length (0x%x)[should be 0x%zx] or addr (0x%p)\n",
 

Oh no... do you really think somebody will search for this message
using strings like "should be"?

Quoted 8 lines
drivers/ide/ide-acpi.c +0 -0
 		       __func__, out_obj->buffer.length,
 		       sizeof(struct GTM_buffer), out_obj->buffer.pointer);
drivers/ide/ide-acpi.c +0 -0
 		return;
drivers/ide/ide-atapi.c +0 -0
index 46cf46e..1e9e2d6 100644

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s) · line 65

Quoted 8 lines
drivers/ide/ide-atapi.c +2 -2
@@ -60,11 +60,13 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
 		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
 			s);
 	else if (drive->media == ide_floppy && drq_type == 3)
-		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
-			"supported\n", s, drq_type);
+		dev_err(&drive->gendev,
+			"%s: sorry, DRQ type (0x%02x) not supported\n",
 

Same question. I think the user will search for "sorry, DRQ type".

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s)

Quoted 7 lines
drivers/ide/ide-atapi.c +3 -2
+			s, drq_type);
 	else if (packet_size != 0)
-		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, packet_size);
+		dev_err(&drive->gendev,
+			"%s: packet size (0x%02x) is not 12 bytes\n",
 

When the message is broken by the format specifier, turning it into
one liner can hardly help seraching...

drivers/ide/ide-atapi.c static ide_startstop_t ide_pc_intr(ide_drive_t *drive) · line 444

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -439,8 +440,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
 		dev_err(&drive->gendev,
-			"The device wants to issue more interrupts "
-			"in DMA mode\n");
+	"The device wants to issue more interrupts in DMA mode\n");
 

Oh noes, the indentation...

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) · line 513

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -509,14 +509,12 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
 	while (retries-- && ((ireason & ATAPI_COD) == 0 ||
 			     (ireason & ATAPI_IO))) {
 		dev_err(&drive->gendev,
-			"(IO,CoD != (0,1) while issuing "
-			"a packet command, retrying\n");
+	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");
 

Sigh...

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
 		udelay(100);
 		ireason = ide_read_ireason(drive);
 		if (retries == 0) {
 			dev_err(&drive->gendev,
-				"(IO,CoD != (0,1) while issuing "
-				"a packet command, ignoring\n");
+	"(IO,CoD != (0,1) while issuing a packet command, ignoring\n");
 

Sigh...

drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) · line 549

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -547,8 +545,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
 		dev_err(&drive->gendev,
-			"Strange, packet command initiated yet "
-			"DRQ isn't asserted\n");
+	"Strange, packet command initiated yet DRQ isn't asserted\n");
 

Sigh...

drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) · line 591

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -590,8 +587,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 		if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
 			dev_err(&drive->gendev,
-				"(IO,CoD) != (0,1) while issuing "
-				"a packet command\n");
+		"(IO,CoD) != (0,1) while issuing a packet command\n");
 

Sigh...

drivers/ide/ide-io.c static void unexpected_intr(int irq, ide_hwif_t *hwif) · line 748

Quoted 13 lines
drivers/ide/ide-io.c +2 -2
index 51c7cb4..07565c9 100644
@@ -743,8 +743,9 @@ static void unexpected_intr(int irq, ide_hwif_t *hwif)
 
 		if (time_after(jiffies, last_msgtime + HZ)) {
 			last_msgtime = jiffies;
-			dev_err(&hwif->gendev, "unexpected interrupt, "
-				"status=0x%02x, count=%ld\n", stat, count);
+			dev_err(&hwif->gendev,
+		"unexpected interrupt, status=0x%02x, count=%ld\n",
 

Hardly won anything...

drivers/ide/ide-iops.c no_80w: · line 264

Quoted 13 lines
drivers/ide/ide-iops.c +2 -2
index 6dbb96e..c5ab2ec 100644
@@ -259,8 +259,8 @@ no_80w:
 	if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
 		return 0;
 
-	dev_warn(&drive->gendev, "%s side 80-wire cable detection failed, "
-		 "limiting max speed to UDMA33\n",
+	dev_warn(&drive->gendev,
+ "%s side 80-wire cable detection failed, limiting max speed to UDMA33\n",
 

Will you really use the full message to serch here?

drivers/ide/ide-probe.c int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id) · line 276

Quoted 13 lines
drivers/ide/ide-probe.c +2 -2
index c4b44e2..a4120e2 100644
@@ -271,8 +271,9 @@ int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id)
 		s = tp_ops->read_status(hwif);
 		if ((a ^ s) & ~ATA_IDX)
 			/* ancient Seagate drives, broken interfaces */
-			dev_info(&drive->gendev, "probing with STATUS(0x%02x) "
-				 "instead of ALTSTATUS(0x%02x)\n", s, a);
+			dev_info(&drive->gendev,
+		 "probing with STATUS(0x%02x) instead of ALTSTATUS(0x%02x)\n",
 

Same comment about the line broken by the format specifiers. This
wins absolutely nothing.

drivers/ide/ide-probe.c static int do_probe (ide_drive_t *drive, u8 cmd) · line 420

Quoted 8 lines
drivers/ide/ide-probe.c +1 -2
@@ -415,8 +416,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 
 		if (rc == 1 && cmd == ATA_CMD_ID_ATAPI) {
 			dev_err(&drive->gendev,
-				"no response (status = 0x%02x), "
-				"resetting drive\n", stat);
+		"no response (status = 0x%02x), resetting drive\n",
 

And again...

drivers/ide/ide-proc.c static int ide_replace_subdriver(ide_drive_t *drive, const char *driver) · line 468

Quoted 12 lines
drivers/ide/ide-proc.c +1 -2
index 23b9d6a..cd580b1 100644
@@ -464,8 +464,7 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
 	strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
 	err = device_attach(dev);
 	if (err < 0)
-		pr_warning("IDE: %s: device_attach error: %d\n",
-			   __func__, err);
+		pr_warning("IDE: %s: device_attach error: %d\n", __func__, err);
 

I'm nt sure why this isn't a part of printk(KERN_*, ...); to
pr_*(...) conversion patch. You're not unsplitting the constant here.

drivers/ide/ide-taskfile.c int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg) · line 584

Quoted 13 lines
drivers/ide/ide-taskfile.c +2 -2
index 8d741d1..687b3be 100644
@@ -579,8 +579,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 		case TASKFILE_MULTI_OUT:
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
-				dev_err(&drive->gendev, "%s Multimode Write " \
-					"multcount is not set\n", __func__);
+				dev_err(&drive->gendev,
+			"%s Multimode Write multcount is not set\n",
 

Sigh...

drivers/ide/ide-taskfile.c int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg) · line 605

Quoted 9 lines
drivers/ide/ide-taskfile.c +2 -2
@@ -599,8 +600,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
 			if (!drive->mult_count) {
 				/* (hs): give up if multcount is not set */
 				dev_err(&drive->gendev,
-					"%s Multimode Read failure "
-					"multcount is not set\n", __func__);
+			"%s Multimode Read failure multcount is not set\n",
+					__func__);
 

Sigh...

drivers/ide/setup-pci.c static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name) · line 44

Quoted 13 lines
drivers/ide/setup-pci.c +2 -2
index f139cf3..3aca89a 100644
@@ -39,17 +39,18 @@ static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)
 	if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 			 (progif & 5) != 5) {
 		if ((progif & 0xa) != 0xa) {
-			pr_info("%s %s: device not capable of full "
-				"native PCI mode\n", name, pci_name(dev));
+			pr_info(
+		"%s %s: device not capable of full native PCI mode\n",
 

Sigh...

drivers/ide/setup-pci.c static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name)

Quoted 8 lines
drivers/ide/setup-pci.c +2 -2
 		(void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5);
 		if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) ||
 		    (progif & 5) != 5) {
-			pr_err("%s %s: rewrite of PROGIF failed, "
-			       "wanted 0x%04x, got 0x%04x\n",
+			pr_err(
+		"%s %s: rewrite of PROGIF failed, wanted 0x%04x, got 0x%04x\n",
 

The same comment about the string broken by yhe format specifiers.
This wins nothing, well, almost...

drivers/ide/setup-pci.c static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d, · line 328

Quoted 9 lines
drivers/ide/setup-pci.c +2 -2
@@ -322,8 +323,8 @@ static int ide_hw_configure(struct pci_dev *dev, const struct ide_port_info *d,
 	if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
 		if (ide_pci_check_iomem(dev, d, 2 * port) ||
 		    ide_pci_check_iomem(dev, d, 2 * port + 1)) {
-			pr_err("%s %s: I/O baseregs (BIOS) are "
-			       "reported as MEM for port %d!\n",
+			pr_err(
+		"%s %s: I/O baseregs (BIOS) are reported as MEM for port %d!\n",
 

Sigh...

drivers/ide/setup-pci.c static int do_ide_setup_pci_device(struct pci_dev *dev, · line 525

Quoted 9 lines
drivers/ide/setup-pci.c +2 -2
@@ -519,8 +520,9 @@ static int do_ide_setup_pci_device(struct pci_dev *dev,
 
 	if (ide_pci_is_in_compatibility_mode(dev)) {
 		if (noisy)
-			pr_info("%s %s: not 100%% native mode: will "
-				"probe irqs later\n", d->name, pci_name(dev));
+			pr_info(
+		"%s %s: not 100%% native mode: will probe irqs later\n",
 

Sigh...

MBR, Sergei

#7 lore raw

Re: [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

Quoted 6 lines · Sergei Shtylyov

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s) · line 68

Quoted 4 lines
drivers/ide/ide-atapi.c +2 -2
-		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, packet_size);
+		dev_err(&drive->gendev,
+			"%s: packet size (0x%02x) is not 12 bytes\n",

When the message is broken by the format specifier, turning it into
one liner can hardly help seraching...

grep "is not 12 bytes"

Quoted 1 line

Oh noes, the indentation...

trade-offs...

Quoted 2 lines

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) · line 512

Quoted 1 line
drivers/ide/ide-atapi.c +1 -0
+	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");

Sigh...

You seem to sigh a lot. ;)

Quoted 6 lines

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) · line 517

Quoted 1 line
drivers/ide/ide-atapi.c +1 -0
+	"(IO,CoD != (0,1) while issuing a packet command, ignoring\n");

Sigh...

drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) · line 548

Quoted 1 line
drivers/ide/ide-atapi.c +1 -0
+	"Strange, packet command initiated yet DRQ isn't asserted\n");

Sigh...

drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) · line 590

Quoted 1 line
drivers/ide/ide-atapi.c +1 -0
+		"(IO,CoD) != (0,1) while issuing a packet command\n");

Sigh...

Quoted 7 lines

drivers/ide/ide-io.c static void unexpected_intr(int irq, ide_hwif_t *hwif) · line 747

Quoted 1 line
drivers/ide/ide-io.c +1 -0
+		"unexpected interrupt, status=0x%02x, count=%ld\n",

Hardly won anything...

Quoted 1 line

+ "%s side 80-wire cable detection failed, limiting max speed to UDMA33\n",

Will you really use the full message to serch here?

drivers/ide/ide-probe.c int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id) · line 275

Quoted 1 line
drivers/ide/ide-probe.c +1 -0
+		 "probing with STATUS(0x%02x) instead of ALTSTATUS(0x%02x)\n",

Same comment about the line broken by the format specifiers. This
wins absolutely nothing.

grep "STATUS.*ALTSTATUS"

Quoted 2 lines

drivers/ide/ide-probe.c static int do_probe (ide_drive_t *drive, u8 cmd) · line 419

Quoted 1 line
drivers/ide/ide-probe.c +1 -0
+		"no response (status = 0x%02x), resetting drive\n",

And again...

grep "response.*resetting"

Quoted 11 lines

drivers/ide/ide-taskfile.c int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg) · line 583

Quoted 1 line
drivers/ide/ide-taskfile.c +1 -0
+			"%s Multimode Write multcount is not set\n",

Sigh...

drivers/ide/ide-taskfile.c int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg) · line 603

Quoted 1 line
drivers/ide/ide-taskfile.c +1 -0
+			"%s Multimode Read failure multcount is not set\n",

Sigh...

drivers/ide/setup-pci.c static int ide_setup_pci_baseregs(struct pci_dev *dev, const char *name) · line 43

Quoted 1 line
drivers/ide/setup-pci.c +1 -0
+		"%s %s: device not capable of full native PCI mode\n",

Sigh...

Review

Quoted 2 lines
(quoted diff) +2 -0
+		"%s %s: rewrite of PROGIF failed, wanted 0x%04x, got 0x%04x\n",
+		"%s %s: I/O baseregs (BIOS) are reported as MEM for port %d!\n",

Sigh...

drivers/ide/setup-pci.c static int do_ide_setup_pci_device(struct pci_dev *dev, · line 524

Quoted 1 line
drivers/ide/setup-pci.c +1 -0
+		"%s %s: not 100%% native mode: will probe irqs later\n",

Sigh...

cheers, Joe

#8 lore raw

Re: [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

Hello.

Quoted 9 lines · Joe Perches
Quoted 7 lines

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s) · line 68

Quoted 4 lines
drivers/ide/ide-atapi.c +2 -2
-		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, packet_size);
+		dev_err(&drive->gendev,
+			"%s: packet size (0x%02x) is not 12 bytes\n",

When the message is broken by the format specifier, turning it into
one liner can hardly help seraching...

grep "is not 12 bytes"

Yes, carrying "is not 12 " to that would have made sense.

Quoted 9 lines
Quoted 1 line

Oh noes, the indentation...

trade-offs...

Quoted 3 lines

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) · line 512

Quoted 1 line
drivers/ide/ide-atapi.c +1 -0
+	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");

Sigh...

You seem to sigh a lot. ;)

I'm not sure you'll like "ugh" better.

Quoted 6 lines
Quoted 6 lines

drivers/ide/ide-io.c static void unexpected_intr(int irq, ide_hwif_t *hwif) · line 747

Quoted 1 line
drivers/ide/ide-io.c +1 -0
+		"unexpected interrupt, status=0x%02x, count=%ld\n",

Hardly won anything...

Quoted 1 line

+ "%s side 80-wire cable detection failed, limiting max speed to UDMA33\n",

Quoted 8 lines
Quoted 6 lines

Will you really use the full message to serch here?

drivers/ide/ide-probe.c int ide_dev_read_id(ide_drive_t *drive, u8 cmd, u16 *id) · line 275

Quoted 1 line
drivers/ide/ide-probe.c +1 -0
+		 "probing with STATUS(0x%02x) instead of ALTSTATUS(0x%02x)\n",

Same comment about the line broken by the format specifiers. This
wins absolutely nothing.

grep "STATUS.*ALTSTATUS"

Hm, I didn't think about wildcards. Yet I find search for "probing with
STATUS" more probable.

Quoted 5 lines
Quoted 3 lines

drivers/ide/ide-probe.c static int do_probe (ide_drive_t *drive, u8 cmd) · line 419

Quoted 1 line
drivers/ide/ide-probe.c +1 -0
+		"no response (status = 0x%02x), resetting drive\n",

And again...

grep "response.*resetting"

I'd grep for "no response (status =" in this case.

Quoted 1 line

cheers, Joe

MBR, Sergei

#9 lore raw

Re: [PATCH 3/3] drivers/ide/ide-core: Unsplit constant strings for pr_<level> and dev_<level>

In reply to Sergei Shtylyov
Quoted 7 lines · On Sunday 24 May 2009 14:12:11 Sergei Shtylyov wrote:

Hello.

Quoted 2 lines · Joe Perches

[...]

Quoted 16 lines

drivers/ide/ide-acpi.c void ide_acpi_get_timing(ide_hwif_t *hwif) · line 440

Quoted 13 lines
drivers/ide/ide-acpi.c +2 -2
index f323a60..560b9c4 100644
@@ -435,8 +435,8 @@ void ide_acpi_get_timing(ide_hwif_t *hwif)
 	if (!out_obj->buffer.length || !out_obj->buffer.pointer ||
 	    out_obj->buffer.length != sizeof(struct GTM_buffer)) {
 		kfree(output.pointer);
-		pr_err("%s: unexpected _GTM length (0x%x)[should be 0x%zx] or "
-		       "addr (0x%p)\n",
+		pr_err(
+	"%s: unexpected _GTM length (0x%x)[should be 0x%zx] or addr (0x%p)\n",
 

Oh no... do you really think somebody will search for this message
using strings like "should be"?

Well, I don't know but the error message should be improved regardless by splitting it on separate messages for separate error conditions (wrong length vs wrong addr).

Quoted 10 lines
Quoted 10 lines
drivers/ide/ide-acpi.c +0 -0
 		       __func__, out_obj->buffer.length,
 		       sizeof(struct GTM_buffer), out_obj->buffer.pointer);
drivers/ide/ide-acpi.c +0 -0
 		return;
drivers/ide/ide-atapi.c +0 -0
index 46cf46e..1e9e2d6 100644
@@ -60,11 +60,13 @@ int ide_check_atapi_device(ide_drive_t *drive, const char *s)
 		dev_err(&drive->gendev, "%s: the removable flag is not set\n",
 			s);
Quoted 8 lines

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s)

Quoted 6 lines
drivers/ide/ide-atapi.c +2 -2
 	else if (drive->media == ide_floppy && drq_type == 3)
-		dev_err(&drive->gendev, "%s: sorry, DRQ type (0x%02x) not "
-			"supported\n", s, drq_type);
+		dev_err(&drive->gendev,
+			"%s: sorry, DRQ type (0x%02x) not supported\n",
 

Same question. I think the user will search for "sorry, DRQ type".

Lets just make it something like:

"%s: unsupported DRQ type (0x%02x)\n"

Quoted 10 lines

drivers/ide/ide-atapi.c int ide_check_atapi_device(ide_drive_t *drive, const char *s)

Quoted 7 lines
drivers/ide/ide-atapi.c +3 -2
+			s, drq_type);
 	else if (packet_size != 0)
-		dev_err(&drive->gendev, "%s: packet size (0x%02x) is not 12 "
-			"bytes\n", s, packet_size);
+		dev_err(&drive->gendev,
+			"%s: packet size (0x%02x) is not 12 bytes\n",
 

When the message is broken by the format specifier, turning it into
one liner can hardly help seraching...

"%s: wrong packet size (0x%02x)\n"

Quoted 10 lines

drivers/ide/ide-atapi.c static ide_startstop_t ide_pc_intr(ide_drive_t *drive) · line 444

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -439,8 +440,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
 		pc->flags &= ~PC_FLAG_DMA_IN_PROGRESS;
 		dev_err(&drive->gendev,
-			"The device wants to issue more interrupts "
-			"in DMA mode\n");
+	"The device wants to issue more interrupts in DMA mode\n");
 

Oh noes, the indentation...

We even know the device name so:

"wants to issue more IRQs in DMA mode\n"

should suffice.

Quoted 11 lines

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) · line 513

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -509,14 +509,12 @@ static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)
 	while (retries-- && ((ireason & ATAPI_COD) == 0 ||
 			     (ireason & ATAPI_IO))) {
 		dev_err(&drive->gendev,
-			"(IO,CoD != (0,1) while issuing "
-			"a packet command, retrying\n");
+	"(IO,CoD != (0,1) while issuing a packet command, retrying\n");
 
   Sigh...
Quoted 10 lines

drivers/ide/ide-atapi.c static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason)

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
 		udelay(100);
 		ireason = ide_read_ireason(drive);
 		if (retries == 0) {
 			dev_err(&drive->gendev,
-				"(IO,CoD != (0,1) while issuing "
-				"a packet command, ignoring\n");
+	"(IO,CoD != (0,1) while issuing a packet command, ignoring\n");
 
   Sigh...

I guess that by "Sigh" you meant:

"while issuing a packet command" should go away

;)

Quoted 10 lines

drivers/ide/ide-atapi.c static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) · line 549

Quoted 8 lines
drivers/ide/ide-atapi.c +1 -2
@@ -547,8 +545,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
 
 	if (ide_wait_stat(&startstop, drive, ATA_DRQ, ATA_BUSY, WAIT_READY)) {
 		dev_err(&drive->gendev,
-			"Strange, packet command initiated yet "
-			"DRQ isn't asserted\n");
+	"Strange, packet command initiated yet DRQ isn't asserted\n");
 
   Sigh...

"DRQ isn't asserted\n" should be enough here

Seems like most (all?) other error messages can be improved in similar way.