[PATCH] PCI probing debug message uniformization

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <jbarnes@...>, <linux-pci@...>, <linux-kernel@...>
Date: Monday, September 29, 2008 - 5:03 pm

Hello,

Here is a patch to uniformize PCI probing debug messages at
boot with dev_printk() intead of manual printk()

for example, it goes from the mixed-style:

PCI: 0000:00:1b.0 reg 10 64bit mmio: [f4280000, f4283fff]
pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold

to uniform:

pci 0000:00:1b.0: reg 10 64bit mmio: [f4280000, f4283fff]
pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold

If people prefer the UPPERCASE "PCI:" prefix from dev_printk(),
that would be matter for another patch...

I'm currently running the kernel with that patch applied, and
diffed bootlog, everything looks OK

Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com>

-- 
Vincent Legoll

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 36698e5..2acb43d 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -304,8 +304,9 @@ static int __pci_read_base(struct pci_dev *dev,
enum pci_bar_type type,
 		} else {
 			res->start = l64;
 			res->end = l64 + sz64;
-			printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
-				pci_name(dev), pos, (unsigned long long)res->start,
+			dev_printk(KERN_DEBUG, &dev->dev,
+				"reg %x 64bit mmio: [%llx, %llx]\n", pos,
+				(unsigned long long)res->start,
 				(unsigned long long)res->end);
 		}
 	} else {
@@ -316,8 +317,8 @@ static int __pci_read_base(struct pci_dev *dev,
enum pci_bar_type type,

 		res->start = l;
 		res->end = l + sz;
-		printk(KERN_DEBUG "PCI: %s reg %x %s: [%llx, %llx]\n", pci_name(dev),
-			pos, (res->flags & IORESOURCE_IO) ? "io port":"32bit mmio",
+		dev_printk(KERN_DEBUG, &dev->dev, "reg %x %s: [%llx, %llx]\n", pos,
+			(res->flags & IORESOURCE_IO) ? "io port" : "32bit mmio",
 			(unsigned long long)res->start, (unsigned long long)res->end);
 	}

@@ -389,8 +390,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
 			res->start = base;
 		if (!res->end)
 			res->end = limit + 0xfff;
-		printk(KERN_DEBUG "PCI: bridge %s io port: [%llx, %llx]\n",
-			pci_name(dev), (unsigned long long) res->start,
+		dev_printk(KERN_DEBUG, &dev->dev, "bridge io port: [%llx, %llx]\n",
+			(unsigned long long) res->start,
 			(unsigned long long) res->end);
 	}

@@ -403,8 +404,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
 		res->start = base;
 		res->end = limit + 0xfffff;
-		printk(KERN_DEBUG "PCI: bridge %s 32bit mmio: [%llx, %llx]\n",
-			pci_name(dev), (unsigned long long) res->start,
+		dev_printk(KERN_DEBUG, &dev->dev, "bridge 32bit mmio: [%llx, %llx]\n",
+			(unsigned long long) res->start,
 			(unsigned long long) res->end);
 	}

@@ -441,8 +442,8 @@ void __devinit pci_read_bridge_bases(struct pci_bus *child)
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) |
IORESOURCE_MEM | IORESOURCE_PREFETCH;
 		res->start = base;
 		res->end = limit + 0xfffff;
-		printk(KERN_DEBUG "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n",
-			pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32",
+		dev_printk(KERN_DEBUG, &dev->dev, "bridge %sbit mmio pref: [%llx, %llx]\n",
+			(res->flags & PCI_PREF_RANGE_TYPE_64) ? "64" : "32",
 			(unsigned long long) res->start, (unsigned long long) res->end);
 	}
 }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] PCI probing debug message uniformization, Vincent Legoll, (Mon Sep 29, 5:03 pm)
Re: [PATCH] PCI probing debug message uniformization, Jesse Barnes, (Thu Oct 2, 2:46 pm)
Re: [PATCH] PCI probing debug message uniformization, Bjorn Helgaas, (Thu Oct 2, 2:59 pm)
Re: [PATCH] PCI probing debug message uniformization, Vincent Legoll, (Fri Oct 3, 5:14 am)
Re: [PATCH] PCI probing debug message uniformization, Vincent Legoll, (Fri Oct 3, 2:13 pm)
Re: [PATCH] PCI probing debug message uniformization, Bjorn Helgaas, (Fri Oct 3, 2:57 pm)
Re: [PATCH] PCI probing debug message uniformization, Vincent Legoll, (Fri Oct 3, 6:50 pm)
Re: [PATCH] PCI probing debug message uniformization, Jesse Barnes, (Fri Oct 10, 12:07 pm)
Re: [PATCH] PCI probing debug message uniformization, Vincent Legoll, (Sun Oct 12, 6:26 am)
Re: [PATCH] PCI probing debug message uniformization, Jesse Barnes, (Wed Oct 15, 6:49 am)