Re: [PATCH] reimplement pci proc name

Martin Zwickel (martin.zwickel@technotrend.de)
Fri, 20 Jun 2003 16:02:28 +0200


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-5096-1056117849-0001-2
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

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>

--=_courier-5096-1056117849-0001-2 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+8xP0mjLYGS7fcG0RAtrOAJ4kOijoMfXdRtRwszM67heUMWIemQCeJZPg HeN+/biXkxwcFllf2N2FDAU= =08qb -----END PGP SIGNATURE-----

--=_courier-5096-1056117849-0001-2--