Re: PATCH: PCI changes for pre-2.3.16-1

Martin Mares (mj@ucw.cz)
Tue, 31 Aug 1999 20:01:20 +0200


Hello Linus,

> > o Distinguish between pci_dev->name (only bus/slot/function, used for
> > PCI subsystem initialization messages) and pci_dev->full_name
> > (used for resource management stuff).
>
> This is just crap.
>
> You should NOT use bus/slot/fn in the name. For identification purposes,
> you can just use the numbers in the "struct pci_dev" thing directly - no
> need to try to continually get them into the name, because they are
> already available as pure numbers.
>
> Numbers are numbers, and should be of type "int" or similar.
>
> Text is text, and should be of type "char []".
>
> Why do you have this need to mix the two?

For "normal" purposes when we need to report information about
the device itself (as in /proc/ioports), we surely should use the
full name which contains only vendor and device.

For "special" purposes like error messages printed by PCI
init code or by device probing in drivers, it's more important
to let the user know the bus and the slot, not the real name
of the device. Hence, you can think of pci_dev->name as of
name of the _slot_ and pci_dev->full_name as of name of the
_device_, but we really need both of them.

Of course, we could reference the numbers stored in pci_dev
and format the slot name again and again in every message the
way we were doing it for years, but making the slot name available
in the pci_dev structure doesn't waste any considerable amount
of memory and makes life easier.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"29A, the hexadecimal of the Beast."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/