Skip to contentSkip to conversation

use lspci style for [%04x:%04x] vendor/device

PATCH In review Bjorn Helgaas 3 participants 10 messages Aug 25, 2008 – Aug 26, 2008

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover use lspci style for [%04x:%04x] vendor/device

These patches change various debug messages to use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

Bjorn

#1 lore raw

PATCH 1/5 x86/PCI: follow lspci device/vendor style

Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

---

 arch/x86/pci/irq.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/pci/irq.c +4 -4
index 8e07718..9e7c862 100644
@@ -493,7 +493,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq
 	if (pirq <= 4)
 		irq = read_config_nybble(router, 0x56, pirq - 1);
 	dev_info(&dev->dev,
-		 "AMD756: dev [%04x/%04x], router PIRQ %d get IRQ %d\n",
+		 "AMD756: dev [%04x:%04x], router PIRQ %d get IRQ %d\n",
 		 dev->vendor, dev->device, pirq, irq);
 	return irq;
 }
@@ -501,7 +501,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq
 static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
 {
 	dev_info(&dev->dev,
-		 "AMD756: dev [%04x/%04x], router PIRQ %d set IRQ %d\n",
+		 "AMD756: dev [%04x:%04x], router PIRQ %d set IRQ %d\n",
 		 dev->vendor, dev->device, pirq, irq);
 	if (pirq <= 4)
 		write_config_nybble(router, 0x56, pirq - 1, irq);
@@ -823,7 +823,7 @@ static void __init pirq_find_router(struct irq_router *r)
 	r->get = NULL;
 	r->set = NULL;
 
-	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n",
+	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
 	    rt->rtr_vendor, rt->rtr_device);
 
 	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
@@ -843,7 +843,7 @@ static void __init pirq_find_router(struct irq_router *r)
 			h->probe(r, pirq_router_dev, pirq_router_dev->device))
 			break;
 	}
-	dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x/%04x]\n",
+	dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x:%04x]\n",
 		 pirq_router.name,
 		 pirq_router_dev->vendor, pirq_router_dev->device);
 
#2 lore raw

PATCH 2/5 AGP: follow lspci device/vendor style

In reply to Bjorn Helgaas

Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

---

 drivers/char/agp/ali-agp.c      |    2 +-
 drivers/char/agp/amd64-agp.c    |    2 +-
 drivers/char/agp/ati-agp.c      |    2 +-
 drivers/char/agp/intel-agp.c    |    2 +-
 drivers/char/agp/isoch.c        |    2 +-
 drivers/char/agp/sis-agp.c      |    2 +-
 drivers/char/agp/sworks-agp.c   |    2 +-
 drivers/char/agp/uninorth-agp.c |    2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
drivers/char/agp/ali-agp.c +1 -1
index 31dcd91..895b4fb 100644
@@ -316,7 +316,7 @@ static int __devinit agp_ali_probe(struct pci_dev *pdev,
 			goto found;
 	}
 
-	dev_err(&pdev->dev, "unsupported ALi chipset [%04x/%04x])\n",
+	dev_err(&pdev->dev, "unsupported ALi chipset [%04x:%04x])\n",
 		pdev->vendor, pdev->device);
 	return -ENODEV;
 
drivers/char/agp/amd64-agp.c +1 -1
index 7495c52..493fca8 100644
@@ -505,7 +505,7 @@ static int __devinit agp_amd64_probe(struct pci_dev *pdev,
 	    pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
 		amd8151_init(pdev, bridge);
 	} else {
-		dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n",
+		dev_info(&pdev->dev, "AGP bridge [%04x:%04x]\n",
 			 pdev->vendor, pdev->device);
 	}
 
drivers/char/agp/ati-agp.c +1 -1
index 6ecbcaf..a12fddb 100644
@@ -486,7 +486,7 @@ static int __devinit agp_ati_probe(struct pci_dev *pdev,
 			goto found;
 	}
 
-	dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n",
+	dev_err(&pdev->dev, "unsupported Ati chipset [%04x:%04x])\n",
 		pdev->vendor, pdev->device);
 	return -ENODEV;
 
drivers/char/agp/intel-agp.c +1 -1
index 016fdf0..3844c46 100644
@@ -2171,7 +2171,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
 
 	if (intel_agp_chipsets[i].name == NULL) {
 		if (cap_ptr)
-			dev_warn(&pdev->dev, "unsupported Intel chipset [%04x/%04x]\n",
+			dev_warn(&pdev->dev, "unsupported Intel chipset [%04x:%04x]\n",
 				 pdev->vendor, pdev->device);
 		agp_put_bridge(bridge);
 		return -ENODEV;
drivers/char/agp/isoch.c +1 -1
index c73385c..f47464f 100644
@@ -359,7 +359,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
 			case 0x0001:    /* Unclassified device */
 				/* Don't know what this is, but log it for investigation. */
 				if (mcapndx != 0) {
-					dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x/%04x]\n",
+					dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x:%04x]\n",
 						 pci_name(dev),
 						 dev->vendor, dev->device);
 				}
drivers/char/agp/sis-agp.c +1 -1
index 2587ef9..8479c25 100644
@@ -188,7 +188,7 @@ static int __devinit agp_sis_probe(struct pci_dev *pdev,
 		return -ENODEV;
 
 
-	dev_info(&pdev->dev, "SiS chipset [%04x/%04x]\n",
+	dev_info(&pdev->dev, "SiS chipset [%04x:%04x]\n",
 		 pdev->vendor, pdev->device);
 	bridge = agp_alloc_bridge();
 	if (!bridge)
drivers/char/agp/sworks-agp.c +1 -1
index 2fb27fe..8b19cff 100644
@@ -464,7 +464,7 @@ static int __devinit agp_serverworks_probe(struct pci_dev *pdev,
 	default:
 		if (cap_ptr)
 			dev_err(&pdev->dev, "unsupported Serverworks chipset "
-				"[%04x/%04x]\n", pdev->vendor, pdev->device);
+				"[%04x:%04x]\n", pdev->vendor, pdev->device);
 		return -ENODEV;
 	}
 
drivers/char/agp/uninorth-agp.c +1 -1
index eef7270..698ebff 100644
@@ -597,7 +597,7 @@ static int __devinit agp_uninorth_probe(struct pci_dev *pdev,
 		}
 	}
 
-	dev_err(&pdev->dev, "unsupported Apple chipset [%04x/%04x]\n",
+	dev_err(&pdev->dev, "unsupported Apple chipset [%04x:%04x]\n",
 		pdev->vendor, pdev->device);
 	return -ENODEV;
 
#3 lore raw

PATCH 3/5 V4L/DVB: follow lspci device/vendor style

In reply to Bjorn Helgaas

Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

---

 drivers/media/dvb/bt8xx/dvb-bt8xx.c               |    2 +-
 drivers/media/dvb/ttpci/av7110.c                  |    2 +-
 drivers/media/dvb/ttpci/budget-av.c               |    2 +-
 drivers/media/dvb/ttpci/budget-ci.c               |    2 +-
 drivers/media/dvb/ttpci/budget-patch.c            |    2 +-
 drivers/media/dvb/ttpci/budget.c                  |    2 +-
 drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c |    2 +-
 drivers/media/dvb/ttusb-dec/ttusb_dec.c           |    2 +-
 drivers/media/video/cx18/cx18-driver.c            |    4 ++--
 drivers/media/video/ivtv/ivtv-driver.c            |    4 ++--
 10 files changed, 12 insertions(+), 12 deletions(-)
drivers/media/dvb/bt8xx/dvb-bt8xx.c +1 -1
index 6afbfbb..48762a2 100644
@@ -702,7 +702,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
 	}
 
 	if (card->fe == NULL)
-		printk("dvb-bt8xx: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n",
+		printk("dvb-bt8xx: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       card->bt->dev->vendor,
 		       card->bt->dev->device,
 		       card->bt->dev->subsystem_vendor,
drivers/media/dvb/ttpci/av7110.c +1 -1
index 0777e8f..3b64180 100644
@@ -2256,7 +2256,7 @@ static int frontend_init(struct av7110 *av7110)
 	if (!av7110->fe) {
 		/* FIXME: propagate the failure code from the lower layers */
 		ret = -ENOMEM;
-		printk("dvb-ttpci: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n",
+		printk("dvb-ttpci: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       av7110->dev->pci->vendor,
 		       av7110->dev->pci->device,
 		       av7110->dev->pci->subsystem_vendor,
drivers/media/dvb/ttpci/budget-av.c +1 -1
index b7d1f2f..839c941 100644
@@ -1049,7 +1049,7 @@ static void frontend_init(struct budget_av *budget_av)
 
 	if (fe == NULL) {
 		printk(KERN_ERR "budget-av: A frontend driver was not found "
-				"for device %04x/%04x subsystem %04x/%04x\n",
+				"for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       saa->pci->vendor,
 		       saa->pci->device,
 		       saa->pci->subsystem_vendor,
drivers/media/dvb/ttpci/budget-ci.c +1 -1
index 060e7c7..38dd5cf 100644
@@ -1153,7 +1153,7 @@ static void frontend_init(struct budget_ci *budget_ci)
 	}
 
 	if (budget_ci->budget.dvb_frontend == NULL) {
-		printk("budget-ci: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n",
+		printk("budget-ci: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       budget_ci->budget.dev->pci->vendor,
 		       budget_ci->budget.dev->pci->device,
 		       budget_ci->budget.dev->pci->subsystem_vendor,
drivers/media/dvb/ttpci/budget-patch.c +1 -1
index 39bd0a2..e568bd0 100644
@@ -359,7 +359,7 @@ static void frontend_init(struct budget_patch* budget)
 	}
 
 	if (budget->dvb_frontend == NULL) {
-		printk("dvb-ttpci: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n",
+		printk("dvb-ttpci: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       budget->dev->pci->vendor,
 		       budget->dev->pci->device,
 		       budget->dev->pci->subsystem_vendor,
drivers/media/dvb/ttpci/budget.c +1 -1
index 2293d80..57709ef 100644
@@ -549,7 +549,7 @@ static void frontend_init(struct budget *budget)
 	}
 
 	if (budget->dvb_frontend == NULL) {
-		printk("budget: A frontend driver was not found for device %04x/%04x subsystem %04x/%04x\n",
+		printk("budget: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       budget->dev->pci->vendor,
 		       budget->dev->pci->device,
 		       budget->dev->pci->subsystem_vendor,
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +1 -1
index e6c9cd2..66ab0c6 100644
@@ -1614,7 +1614,7 @@ static void frontend_init(struct ttusb* ttusb)
 	}
 
 	if (ttusb->fe == NULL) {
-		printk("dvb-ttusb-budget: A frontend driver was not found for device %04x/%04x\n",
+		printk("dvb-ttusb-budget: A frontend driver was not found for device [%04x:%04x]\n",
 		       le16_to_cpu(ttusb->dev->descriptor.idVendor),
 		       le16_to_cpu(ttusb->dev->descriptor.idProduct));
 	} else {
drivers/media/dvb/ttusb-dec/ttusb_dec.c +1 -1
index de5829b..ab33fec 100644
@@ -1665,7 +1665,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
 	}
 
 	if (dec->fe == NULL) {
-		printk("dvb-ttusb-dec: A frontend driver was not found for device %04x/%04x\n",
+		printk("dvb-ttusb-dec: A frontend driver was not found for device [%04x:%04x]\n",
 		       le16_to_cpu(dec->udev->descriptor.idVendor),
 		       le16_to_cpu(dec->udev->descriptor.idProduct));
 	} else {
drivers/media/video/cx18/cx18-driver.c +2 -2
index 22434aa..a819140 100644
@@ -395,9 +395,9 @@ done:
 
 	if (cx->card == NULL) {
 		cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);
-		CX18_ERR("Unknown card: vendor/device: %04x/%04x\n",
+		CX18_ERR("Unknown card: vendor/device: [%04x:%04x]\n",
 		     cx->dev->vendor, cx->dev->device);
-		CX18_ERR("              subsystem vendor/device: %04x/%04x\n",
+		CX18_ERR("              subsystem vendor/device: [%04x:%04x]\n",
 		     cx->dev->subsystem_vendor, cx->dev->subsystem_device);
 		CX18_ERR("Defaulting to %s card\n", cx->card->name);
 		CX18_ERR("Please mail the vendor/device and subsystem vendor/device IDs and what kind of\n");
drivers/media/video/ivtv/ivtv-driver.c +2 -2
index aea1664..70a8ad0 100644
@@ -655,9 +655,9 @@ done:
 
 	if (itv->card == NULL) {
 		itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
-		IVTV_ERR("Unknown card: vendor/device: %04x/%04x\n",
+		IVTV_ERR("Unknown card: vendor/device: [%04x:%04x]\n",
 		     itv->dev->vendor, itv->dev->device);
-		IVTV_ERR("              subsystem vendor/device: %04x/%04x\n",
+		IVTV_ERR("              subsystem vendor/device: [%04x:%04x]\n",
 		     itv->dev->subsystem_vendor, itv->dev->subsystem_device);
 		IVTV_ERR("              %s based\n", chipname);
 		IVTV_ERR("Defaulting to %s card\n", itv->card->name);
#4 lore raw

PATCH 4/5 IRDA: follow lspci device/vendor style

In reply to Bjorn Helgaas

Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

---

 drivers/net/irda/vlsi_ir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/irda/vlsi_ir.c +1 -1
index 18f4b3a..9c926d2 100644
@@ -165,7 +165,7 @@ static void vlsi_proc_pdev(struct seq_file *seq, struct pci_dev *pdev)
 	unsigned iobase = pci_resource_start(pdev, 0);
 	unsigned i;
 
-	seq_printf(seq, "\n%s (vid/did: %04x/%04x)\n",
+	seq_printf(seq, "\n%s (vid/did: [%04x:%04x])\n",
 		   pci_name(pdev), (int)pdev->vendor, (int)pdev->device);
 	seq_printf(seq, "pci-power-state: %u\n", (unsigned) pdev->current_state);
 	seq_printf(seq, "resources: irq=%u / io=0x%04x / dma_mask=0x%016Lx\n",
#5 lore raw

PATCH 5/5 PCI: follow lspci device/vendor style

In reply to Bjorn Helgaas

Use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

---

 drivers/pci/pcie/portdrv_pci.c |    2 +-
 drivers/pci/probe.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/pcie/portdrv_pci.c +1 -1
index 367c9c2..584422d 100644
@@ -91,7 +91,7 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev,
 	
 	pci_set_master(dev);
         if (!dev->irq && dev->pin) {
-		dev_warn(&dev->dev, "device [%04x/%04x] has invalid IRQ; "
+		dev_warn(&dev->dev, "device [%04x:%04x] has invalid IRQ; "
 			 "check vendor BIOS\n", dev->vendor, dev->device);
 	}
 	if (pcie_port_device_register(dev)) {
drivers/pci/probe.c +1 -1
index cce2f4c..d58078c 100644
@@ -752,7 +752,7 @@ static int pci_setup_device(struct pci_dev * dev)
 	dev->class = class;
 	class >>= 8;
 
-	dev_dbg(&dev->dev, "found [%04x/%04x] class %06x header type %02x\n",
+	dev_dbg(&dev->dev, "found [%04x:%04x] class %06x header type %02x\n",
 		 dev->vendor, dev->device, class, dev->hdr_type);
 
 	/* "Unknown power state" */
#6 lore raw
In reply to Bjorn Helgaas
Quoted 2 lines · On Mon, 25 Aug 2008 16:01:38 -0600 Bjorn Helgaas <[email protected]> wrote:

These patches change various debug messages to use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

I hope you're adding a new whicked special format specifier for this ... taking a PCI dev struct as argument.

That's be really nice to have;-)

Signature · 3 lines
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
#7 lore raw
Quoted 10 lines · Arjan van de Ven
Quoted 2 lines · On Mon, 25 Aug 2008 16:01:38 -0600 Bjorn Helgaas <[email protected]> wrote:

These patches change various debug messages to use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

I hope you're adding a new whicked special format specifier for this ... taking a PCI dev struct as argument.

That's be really nice to have;-)

Huh, that's kind of a cool idea. The %p<x> namespace is unlimited, right? If it were only a single character specifier, this one doesn't seem common enough to eat 1/26 of the space.

#8 lore raw
In reply to Arjan van de Ven
Quoted 10 lines · Arjan van de Ven
Quoted 2 lines · On Mon, 25 Aug 2008 16:01:38 -0600 Bjorn Helgaas <[email protected]> wrote:

These patches change various debug messages to use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

I hope you're adding a new whicked special format specifier for this ... taking a PCI dev struct as argument.

That's be really nice to have;-)

You should sign Treaty of the Non-Proliferation of Format Specifiers.

Untill too late...

#9 lore raw
Quoted 7 lines · Alexey Dobriyan
Quoted 6 lines · Arjan van de Ven
Quoted 2 lines · On Mon, 25 Aug 2008 16:01:38 -0600 Bjorn Helgaas <[email protected]> wrote:

These patches change various debug messages to use "[%04x:%04x]" for PCI vendor/device IDs to follow the format used by lspci(8).

Quoted 8 lines
Quoted 4 lines

I hope you're adding a new whicked special format specifier for this ... taking a PCI dev struct as argument.

That's be really nice to have;-)

You should sign Treaty of the Non-Proliferation of Format Specifiers.

Untill too late...

OK. I'll wait with any new format specifiers for now. Relative to something like printing resources, where a new format specifier could help get rid of a ton of ugly casts, this PCI vendor/device stuff is pretty minor.

Bjorn