Messages in this thread Patch in this message | | | Date | Fri, 20 Jun 2003 16:02:28 +0200 | From | Martin Zwickel <> | Subject | Re: [PATCH] reimplement pci proc name |
| |
Hi Matthew!
Just one question: If pci_name_bus copies the bus' hex to name and always returns 0, the "if (!pci_name_bus(name, bus)) return -EEXIST;" would always be true, right?
Or did I miss something?
Regards, Martin
On Fri, 20 Jun 2003 14:48:11 +0100 Matthew Wilcox <willy@debian.org> bubbled:
> > Index: drivers/pci/proc.c > =================================================================== > RCS file: /var/cvs/linux-2.5/drivers/pci/proc.c,v > retrieving revision 1.9 > diff -u -p -r1.9 proc.c > --- drivers/pci/proc.c 14 Jun 2003 22:15:29 -0000 1.9 > +++ drivers/pci/proc.c 17 Jun 2003 19:36:50 -0000 > @@ -383,7 +383,8 @@ int pci_proc_attach_device(struct pci_de > return -EACCES; > > if (!(de = bus->procdir)) { > - sprintf(name, "%02x", bus->number); > + if (!pci_name_bus(name, bus)) > + return -EEXIST; > de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir); > if (!de) > return -ENOMEM;
> Index: include/linux/pci.h > =================================================================== > RCS file: /var/cvs/linux-2.5/include/linux/pci.h,v > retrieving revision 1.17 > diff -u -p -r1.17 pci.h > --- include/linux/pci.h 14 Jun 2003 22:16:01 -0000 1.17 > +++ include/linux/pci.h 19 Jun 2003 00:55:35 -0000 > @@ -808,6 +815,11 @@ extern int pci_pci_problems; > > #ifndef CONFIG_PCI_DOMAINS > static inline int pci_domain_nr(struct pci_bus *bus) { return 0; } > +static inline int pci_name_bus(char *name, struct pci_bus *bus) > +{ > + sprintf(name, "%02x", bus->number); > + return 0; > +} > #endif > > #endif /* __KERNEL__ */ >
-- MyExcuse: Backbone adjustment
Martin Zwickel <martin.zwickel@technotrend.de> Research & Development
TechnoTrend AG <http://www.technotrend.de> [unhandled content-type:application/pgp-signature] | |