The example on p. 294 of Venkateswaran's fine new _Essential Linux
Device Drivers_ says:
#include <linux/pci.h>
struct pci_device_id network_driver_pci_table[] __devinitdata {
[ . . . stuff . . . ]
};
I see that __devinitdata is defined in init.h and pci_device_id is
defined in pci.h, but
*Question*: the statement
struct pci_device_id network_driver_pci_table[]{};
defines network_driver_pci_table as an array of structs of type
pci_device_id. What is the extra qualifier __devinitdata doing
after the
struct pci_device_id network_driver_pci_table[]
declaration? I don't understand how this is legal C. We can't just
go on and on with an arbitrary number of qualifiers, can we? And
init.h says
#ifdef CONFIG_HOTPLUG
#define __devinitdata
So we're putting a compiler flag in a struct definition??
Thanks for your patience with my true-newb question.
--
Alison Chaiken
(650) 279-5600 (cell)
http://www.exerciseforthereader.org/
The only real deadline in life is the one where you actually die. -- Eliot D.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ