[PATCH] nonempty bus->name for PHBs

John Rose johnrose at austin.ibm.com
Wed Feb 4 03:17:48 EST 2004


Hi Olof-

On Mon, 2004-02-02 at 23:14, olof at austin.ibm.com wrote:
> I'm wondering if #%02x is a bad choice of format, since how should #10 be
> parsed? Is it 10 or 16? It might be hard to tell when you're sitting there
> reading the output. How about 0x%02x instead?

Good point.  I directly copied this from pci_scan_bridge(), but your
suggestion makes things more clear.

>
> Also, how large is the buffer? Should you use snprintf just to be safe?

Eh.  The buffer is 48 chars long, and the other piece of code doesn't
use snprintf().  Maybe I'm being careless, but...

New patch attached!

Thanks-
John

diff -Nru a/arch/ppc64/kernel/pSeries_pci.c b/arch/ppc64/kernel/pSeries_pci.c
--- a/arch/ppc64/kernel/pSeries_pci.c	Tue Feb  3 10:16:39 2004
+++ b/arch/ppc64/kernel/pSeries_pci.c	Tue Feb  3 10:16:39 2004
@@ -565,6 +565,8 @@
 				printk(KERN_ERR "Failed to request MEM"
 						"on hose %d\n", 0 /* FIXME */);
 		}
+		sprintf(bus->name, "PCI Host Bridge 0x%02x",
+				pci_domain_nr(bus));
 	} else if (pci_probe_only &&
 		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
 		/* This is a subordinate bridge */


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list