Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a44fec1f authored by Joe Perches's avatar Joe Perches Committed by Jeff Garzik
Browse files

ata: Convert dev_printk(KERN_<LEVEL> to dev_<level>(



Saves a bit of text as the call takes fewer args.

Coalesce a few formats.
Convert a few bare printks to pr_cont.

$ size drivers/ata/built-in.o*
   text	   data	    bss	    dec	    hex	filename
 558429	  73893	 117864	 750186	  b726a	drivers/ata/built-in.o.allyesconfig.new
 559574	  73893	 117888	 751355	  b76fb	drivers/ata/built-in.o.allyesconfig.old
 149567	  14689	   4220	 168476	  2921c	drivers/ata/built-in.o.defconfig.new
 149851	  14689	   4220	 168760	  29338	drivers/ata/built-in.o.defconfig.old

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 02f8c6ae
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg

	if (mesg.event & PM_EVENT_SUSPEND &&
	    hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
		dev_printk(KERN_ERR, &pdev->dev,
		dev_err(&pdev->dev,
			"BIOS update required for suspend/resume\n");
		return -EIO;
	}
@@ -187,7 +187,7 @@ static int acard_ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
		if (rc) {
			rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
			if (rc) {
				dev_printk(KERN_ERR, &pdev->dev,
				dev_err(&pdev->dev,
					   "64-bit DMA enable failed\n");
				return rc;
			}
@@ -195,13 +195,12 @@ static int acard_ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
	} else {
		rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
		if (rc) {
			dev_printk(KERN_ERR, &pdev->dev,
				   "32-bit DMA enable failed\n");
			dev_err(&pdev->dev, "32-bit DMA enable failed\n");
			return rc;
		}
		rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
		if (rc) {
			dev_printk(KERN_ERR, &pdev->dev,
			dev_err(&pdev->dev,
				"32-bit consistent DMA enable failed\n");
			return rc;
		}
@@ -343,13 +342,11 @@ static int acard_ahci_port_start(struct ata_port *ap)
		if (cmd & PORT_CMD_FBSCP)
			pp->fbs_supported = true;
		else if (hpriv->flags & AHCI_HFLAG_YES_FBS) {
			dev_printk(KERN_INFO, dev,
				   "port %d can do FBS, forcing FBSCP\n",
			dev_info(dev, "port %d can do FBS, forcing FBSCP\n",
				 ap->port_no);
			pp->fbs_supported = true;
		} else
			dev_printk(KERN_WARNING, dev,
				   "port %d is not capable of FBS\n",
			dev_warn(dev, "port %d is not capable of FBS\n",
				 ap->port_no);
	}

+21 −23
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)

	if (mesg.event & PM_EVENT_SUSPEND &&
	    hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
		dev_printk(KERN_ERR, &pdev->dev,
		dev_err(&pdev->dev,
			"BIOS update required for suspend/resume\n");
		return -EIO;
	}
@@ -681,7 +681,7 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
		if (rc) {
			rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
			if (rc) {
				dev_printk(KERN_ERR, &pdev->dev,
				dev_err(&pdev->dev,
					"64-bit DMA enable failed\n");
				return rc;
			}
@@ -689,13 +689,12 @@ static int ahci_configure_dma_masks(struct pci_dev *pdev, int using_dac)
	} else {
		rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
		if (rc) {
			dev_printk(KERN_ERR, &pdev->dev,
				   "32-bit DMA enable failed\n");
			dev_err(&pdev->dev, "32-bit DMA enable failed\n");
			return rc;
		}
		rc = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
		if (rc) {
			dev_printk(KERN_ERR, &pdev->dev,
			dev_err(&pdev->dev,
				"32-bit consistent DMA enable failed\n");
			return rc;
		}
@@ -759,8 +758,8 @@ static void ahci_p5wdh_workaround(struct ata_host *host)
	    dmi_check_system(sysids)) {
		struct ata_port *ap = host->ports[1];

		dev_printk(KERN_INFO, &pdev->dev, "enabling ASUS P5W DH "
			   "Deluxe on-board SIMG4726 workaround\n");
		dev_info(&pdev->dev,
			 "enabling ASUS P5W DH Deluxe on-board SIMG4726 workaround\n");

		ap->ops = &ahci_p5wdh_ops;
		ap->link.flags |= ATA_LFLAG_NO_SRST | ATA_LFLAG_ASSUME_ATA;
@@ -831,14 +830,14 @@ static bool ahci_sb600_enable_64bit(struct pci_dev *pdev)
	if (strcmp(buf, match->driver_data) >= 0)
		goto enable_64bit;
	else {
		dev_printk(KERN_WARNING, &pdev->dev, "%s: BIOS too old, "
			   "forcing 32bit DMA, update BIOS\n", match->ident);
		dev_warn(&pdev->dev,
			 "%s: BIOS too old, forcing 32bit DMA, update BIOS\n",
			 match->ident);
		return false;
	}

enable_64bit:
	dev_printk(KERN_WARNING, &pdev->dev, "%s: enabling 64bit DMA\n",
		   match->ident);
	dev_warn(&pdev->dev, "%s: enabling 64bit DMA\n", match->ident);
	return true;
}

@@ -1041,8 +1040,7 @@ static void ahci_gtf_filter_workaround(struct ata_host *host)
		return;

	filter = (unsigned long)dmi->driver_data;
	dev_printk(KERN_INFO, host->dev,
		   "applying extra ACPI _GTF filter 0x%x for %s\n",
	dev_info(host->dev, "applying extra ACPI _GTF filter 0x%x for %s\n",
		 filter, dmi->ident);

	for (i = 0; i < host->n_ports; i++) {
@@ -1099,8 +1097,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
	 * that for SAS drives they're out of luck.
	 */
	if (pdev->vendor == PCI_VENDOR_ID_PROMISE)
		dev_printk(KERN_INFO, &pdev->dev, "PDC42819 "
			   "can only drive SATA devices with this driver\n");
		dev_info(&pdev->dev,
			 "PDC42819 can only drive SATA devices with this driver\n");

	/* acquire resources */
	rc = pcim_enable_device(pdev);
@@ -1126,8 +1124,8 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
		 */
		pci_read_config_byte(pdev, ICH_MAP, &map);
		if (map & 0x3) {
			dev_printk(KERN_INFO, &pdev->dev, "controller is in "
				   "combined mode, can't enable AHCI mode\n");
			dev_info(&pdev->dev,
				 "controller is in combined mode, can't enable AHCI mode\n");
			return -ENODEV;
		}
	}
@@ -1184,7 +1182,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

	if (ahci_broken_suspend(pdev)) {
		hpriv->flags |= AHCI_HFLAG_NO_SUSPEND;
		dev_printk(KERN_WARNING, &pdev->dev,
		dev_warn(&pdev->dev,
			 "BIOS update required for suspend/resume\n");
	}

+20 −19
Original line number Diff line number Diff line
@@ -1225,8 +1225,9 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
		 */
		rc = pci_reenable_device(pdev);
		if (rc)
			dev_printk(KERN_ERR, &pdev->dev, "failed to enable "
				   "device after resume (%d)\n", rc);
			dev_err(&pdev->dev,
				"failed to enable device after resume (%d)\n",
				rc);
	} else
		rc = ata_pci_device_do_resume(pdev);

@@ -1303,9 +1304,11 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev)
			no_piix_dma = 2;
	}
	if (no_piix_dma)
		dev_printk(KERN_WARNING, &ata_dev->dev, "450NX errata present, disabling IDE DMA.\n");
	if (no_piix_dma == 2)
		dev_printk(KERN_WARNING, &ata_dev->dev, "A BIOS update may resolve this.\n");
		dev_warn(&ata_dev->dev,
			 "450NX errata present, disabling IDE DMA%s\n",
			 no_piix_dma == 2 ? " - a BIOS update may resolve this"
			 : "");

	return no_piix_dma;
}

@@ -1338,37 +1341,36 @@ static const int *__devinit piix_init_sata_map(struct pci_dev *pdev,

	map = map_db->map[map_value & map_db->mask];

	dev_printk(KERN_INFO, &pdev->dev, "MAP [");
	dev_info(&pdev->dev, "MAP [");
	for (i = 0; i < 4; i++) {
		switch (map[i]) {
		case RV:
			invalid_map = 1;
			printk(" XX");
			pr_cont(" XX");
			break;

		case NA:
			printk(" --");
			pr_cont(" --");
			break;

		case IDE:
			WARN_ON((i & 1) || map[i + 1] != IDE);
			pinfo[i / 2] = piix_port_info[ich_pata_100];
			i++;
			printk(" IDE IDE");
			pr_cont(" IDE IDE");
			break;

		default:
			printk(" P%d", map[i]);
			pr_cont(" P%d", map[i]);
			if (i & 1)
				pinfo[i / 2].flags |= ATA_FLAG_SLAVE_POSS;
			break;
		}
	}
	printk(" ]\n");
	pr_cont(" ]\n");

	if (invalid_map)
		dev_printk(KERN_ERR, &pdev->dev,
			   "invalid MAP value %u\n", map_value);
		dev_err(&pdev->dev, "invalid MAP value %u\n", map_value);

	return map;
}
@@ -1398,7 +1400,7 @@ static bool piix_no_sidpr(struct ata_host *host)
	if (pdev->vendor == PCI_VENDOR_ID_INTEL && pdev->device == 0x2920 &&
	    pdev->subsystem_vendor == PCI_VENDOR_ID_SAMSUNG &&
	    pdev->subsystem_device == 0xb049) {
		dev_printk(KERN_WARNING, host->dev,
		dev_warn(host->dev,
			 "Samsung DB-P70 detected, disabling SIDPR\n");
		return true;
	}
@@ -1451,8 +1453,8 @@ static int __devinit piix_init_sidpr(struct ata_host *host)
		piix_sidpr_scr_read(link0, SCR_CONTROL, &scontrol);

		if ((scontrol & 0xf00) != 0x300) {
			dev_printk(KERN_INFO, host->dev, "SCR access via "
				   "SIDPR is available but doesn't work\n");
			dev_info(host->dev,
				 "SCR access via SIDPR is available but doesn't work\n");
			return 0;
		}
	}
@@ -1501,8 +1503,7 @@ static void piix_iocfg_bit18_quirk(struct ata_host *host)
	 * affected systems.
	 */
	if (hpriv->saved_iocfg & (1 << 18)) {
		dev_printk(KERN_INFO, &pdev->dev,
			   "applying IOCFG bit18 quirk\n");
		dev_info(&pdev->dev, "applying IOCFG bit18 quirk\n");
		pci_write_config_dword(pdev, PIIX_IOCFG,
				       hpriv->saved_iocfg & ~(1 << 18));
	}
+30 −41
Original line number Diff line number Diff line
@@ -410,49 +410,44 @@ void ahci_save_initial_config(struct device *dev,

	/* some chips have errata preventing 64bit use */
	if ((cap & HOST_CAP_64) && (hpriv->flags & AHCI_HFLAG_32BIT_ONLY)) {
		dev_printk(KERN_INFO, dev,
			   "controller can't do 64bit DMA, forcing 32bit\n");
		dev_info(dev, "controller can't do 64bit DMA, forcing 32bit\n");
		cap &= ~HOST_CAP_64;
	}

	if ((cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_NO_NCQ)) {
		dev_printk(KERN_INFO, dev,
			   "controller can't do NCQ, turning off CAP_NCQ\n");
		dev_info(dev, "controller can't do NCQ, turning off CAP_NCQ\n");
		cap &= ~HOST_CAP_NCQ;
	}

	if (!(cap & HOST_CAP_NCQ) && (hpriv->flags & AHCI_HFLAG_YES_NCQ)) {
		dev_printk(KERN_INFO, dev,
			   "controller can do NCQ, turning on CAP_NCQ\n");
		dev_info(dev, "controller can do NCQ, turning on CAP_NCQ\n");
		cap |= HOST_CAP_NCQ;
	}

	if ((cap & HOST_CAP_PMP) && (hpriv->flags & AHCI_HFLAG_NO_PMP)) {
		dev_printk(KERN_INFO, dev,
			   "controller can't do PMP, turning off CAP_PMP\n");
		dev_info(dev, "controller can't do PMP, turning off CAP_PMP\n");
		cap &= ~HOST_CAP_PMP;
	}

	if ((cap & HOST_CAP_SNTF) && (hpriv->flags & AHCI_HFLAG_NO_SNTF)) {
		dev_printk(KERN_INFO, dev,
		dev_info(dev,
			 "controller can't do SNTF, turning off CAP_SNTF\n");
		cap &= ~HOST_CAP_SNTF;
	}

	if (!(cap & HOST_CAP_FBS) && (hpriv->flags & AHCI_HFLAG_YES_FBS)) {
		dev_printk(KERN_INFO, dev,
			   "controller can do FBS, turning on CAP_FBS\n");
		dev_info(dev, "controller can do FBS, turning on CAP_FBS\n");
		cap |= HOST_CAP_FBS;
	}

	if (force_port_map && port_map != force_port_map) {
		dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n",
		dev_info(dev, "forcing port_map 0x%x -> 0x%x\n",
			 port_map, force_port_map);
		port_map = force_port_map;
	}

	if (mask_port_map) {
		dev_printk(KERN_WARNING, dev, "masking port_map 0x%x -> 0x%x\n",
		dev_warn(dev, "masking port_map 0x%x -> 0x%x\n",
			port_map,
			port_map & mask_port_map);
		port_map &= mask_port_map;
@@ -470,9 +465,8 @@ void ahci_save_initial_config(struct device *dev,
		 * port_map and let it be generated from n_ports.
		 */
		if (map_ports > ahci_nr_ports(cap)) {
			dev_printk(KERN_WARNING, dev,
				   "implemented port map (0x%x) contains more "
				   "ports than nr_ports (%u), using nr_ports\n",
			dev_warn(dev,
				 "implemented port map (0x%x) contains more ports than nr_ports (%u), using nr_ports\n",
				 port_map, ahci_nr_ports(cap));
			port_map = 0;
		}
@@ -481,8 +475,7 @@ void ahci_save_initial_config(struct device *dev,
	/* fabricate port_map from cap.nr_ports */
	if (!port_map) {
		port_map = (1 << ahci_nr_ports(cap)) - 1;
		dev_printk(KERN_WARNING, dev,
			   "forcing PORTS_IMPL to 0x%x\n", port_map);
		dev_warn(dev, "forcing PORTS_IMPL to 0x%x\n", port_map);

		/* write the fixed up value to the PI register */
		hpriv->saved_port_map = port_map;
@@ -822,8 +815,8 @@ int ahci_reset_controller(struct ata_host *host)
					HOST_RESET, 10, 1000);

		if (tmp & HOST_RESET) {
			dev_printk(KERN_ERR, host->dev,
				   "controller reset failed (0x%x)\n", tmp);
			dev_err(host->dev, "controller reset failed (0x%x)\n",
				tmp);
			return -EIO;
		}

@@ -835,8 +828,7 @@ int ahci_reset_controller(struct ata_host *host)
		 */
		ahci_restore_initial_config(host);
	} else
		dev_printk(KERN_INFO, host->dev,
			   "skipping global host reset\n");
		dev_info(host->dev, "skipping global host reset\n");

	return 0;
}
@@ -1474,8 +1466,7 @@ static void ahci_fbs_dec_intr(struct ata_port *ap)
	}

	if (fbs & PORT_FBS_DEC)
		dev_printk(KERN_ERR, ap->host->dev,
			   "failed to clear device error\n");
		dev_err(ap->host->dev, "failed to clear device error\n");
}

static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
@@ -1713,7 +1704,7 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance)
		} else {
			VPRINTK("port %u (no irq)\n", i);
			if (ata_ratelimit())
				dev_printk(KERN_WARNING, host->dev,
				dev_warn(host->dev,
					 "interrupt on disabled port %u\n", i);
		}

@@ -1865,11 +1856,11 @@ static void ahci_enable_fbs(struct ata_port *ap)
	writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS);
	fbs = readl(port_mmio + PORT_FBS);
	if (fbs & PORT_FBS_EN) {
		dev_printk(KERN_INFO, ap->host->dev, "FBS is enabled.\n");
		dev_info(ap->host->dev, "FBS is enabled\n");
		pp->fbs_enabled = true;
		pp->fbs_last_dev = -1; /* initialization */
	} else
		dev_printk(KERN_ERR, ap->host->dev, "Failed to enable FBS\n");
		dev_err(ap->host->dev, "Failed to enable FBS\n");

	ahci_start_engine(ap);
}
@@ -1897,9 +1888,9 @@ static void ahci_disable_fbs(struct ata_port *ap)
	writel(fbs & ~PORT_FBS_EN, port_mmio + PORT_FBS);
	fbs = readl(port_mmio + PORT_FBS);
	if (fbs & PORT_FBS_EN)
		dev_printk(KERN_ERR, ap->host->dev, "Failed to disable FBS\n");
		dev_err(ap->host->dev, "Failed to disable FBS\n");
	else {
		dev_printk(KERN_INFO, ap->host->dev, "FBS is disabled.\n");
		dev_info(ap->host->dev, "FBS is disabled\n");
		pp->fbs_enabled = false;
	}

@@ -2003,13 +1994,11 @@ static int ahci_port_start(struct ata_port *ap)
		if (cmd & PORT_CMD_FBSCP)
			pp->fbs_supported = true;
		else if (hpriv->flags & AHCI_HFLAG_YES_FBS) {
			dev_printk(KERN_INFO, dev,
				   "port %d can do FBS, forcing FBSCP\n",
			dev_info(dev, "port %d can do FBS, forcing FBSCP\n",
				 ap->port_no);
			pp->fbs_supported = true;
		} else
			dev_printk(KERN_WARNING, dev,
				   "port %d is not capable of FBS\n",
			dev_warn(dev, "port %d is not capable of FBS\n",
				 ap->port_no);
	}

+6 −7
Original line number Diff line number Diff line
@@ -5847,9 +5847,9 @@ int ata_host_start(struct ata_host *host)
			rc = ap->ops->port_start(ap);
			if (rc) {
				if (rc != -ENODEV)
					dev_printk(KERN_ERR, host->dev,
						"failed to start port %d "
						"(errno=%d)\n", i, rc);
					dev_err(host->dev,
						"failed to start port %d (errno=%d)\n",
						i, rc);
				goto err_out;
			}
		}
@@ -5971,8 +5971,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)

	/* host must have been started */
	if (!(host->flags & ATA_HOST_STARTED)) {
		dev_printk(KERN_ERR, host->dev,
			   "BUG: trying to register unstarted host\n");
		dev_err(host->dev, "BUG: trying to register unstarted host\n");
		WARN_ON(1);
		return -EINVAL;
	}
@@ -6242,7 +6241,7 @@ int ata_pci_device_do_resume(struct pci_dev *pdev)

	rc = pcim_enable_device(pdev);
	if (rc) {
		dev_printk(KERN_ERR, &pdev->dev,
		dev_err(&pdev->dev,
			"failed to enable device after resume (%d)\n", rc);
		return rc;
	}
Loading