diff options
author | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2005-02-02 12:34:32 +0000 |
---|---|---|
committer | iap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk> | 2005-02-02 12:34:32 +0000 |
commit | 395321fa8e96dd0830de8d39aad7d7e0d1b23874 (patch) | |
tree | c18ef276c33dca478a1a576da1c3fc41df5a760e /xen/drivers/pci | |
parent | 2ce341cd778aef9e25a811a40ebd2b73e6647a85 (diff) | |
download | xen-395321fa8e96dd0830de8d39aad7d7e0d1b23874.tar.gz xen-395321fa8e96dd0830de8d39aad7d7e0d1b23874.tar.bz2 xen-395321fa8e96dd0830de8d39aad7d7e0d1b23874.zip |
bitkeeper revision 1.1159.238.1 (4200c8d8KsGlaM3w6o3y4GHhK1jKjg)
A typesafe allocator submitted by Rusty Russel with trivial renames by me.
Signed-off-by: Rusty Russel <rusty@rustcorp.com.au> (authored)
Signed-off-by: ian.pratt@cl.cam.ac.uk
Diffstat (limited to 'xen/drivers/pci')
-rw-r--r-- | xen/drivers/pci/pci.c | 6 | ||||
-rw-r--r-- | xen/drivers/pci/setup-res.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c index 50a4ebb5e0..c3c25b1dba 100644 --- a/xen/drivers/pci/pci.c +++ b/xen/drivers/pci/pci.c @@ -1126,7 +1126,7 @@ static struct pci_bus * __devinit pci_alloc_bus(void) { struct pci_bus *b; - b = xmalloc(sizeof(*b)); + b = xmalloc(struct pci_bus); if (b) { memset(b, 0, sizeof(*b)); INIT_LIST_HEAD(&b->children); @@ -1351,7 +1351,7 @@ struct pci_dev * __devinit pci_scan_device(struct pci_dev *temp) if (l == 0xffffffff || l == 0x00000000 || l == 0x0000ffff || l == 0xffff0000) return NULL; - dev = xmalloc(sizeof(*dev)); + dev = xmalloc(struct pci_dev); if (!dev) return NULL; @@ -1431,7 +1431,7 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus) max = bus->secondary; /* Create a device template */ - dev0 = xmalloc(sizeof(struct pci_dev)); + dev0 = xmalloc(struct pci_dev); if(!dev0) { panic("Out of memory scanning PCI bus!\n"); } diff --git a/xen/drivers/pci/setup-res.c b/xen/drivers/pci/setup-res.c index 3435b2ac9c..59652dbcc7 100644 --- a/xen/drivers/pci/setup-res.c +++ b/xen/drivers/pci/setup-res.c @@ -171,10 +171,10 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head) ln->res->start; } if (r_align > align) { - tmp = xmalloc(sizeof(*tmp)); + tmp = xmalloc(struct resource_list); if (!tmp) panic("pdev_sort_resources(): " - "xmalloc() failed!\n"); + "malloc() failed!\n"); tmp->next = ln; tmp->res = r; tmp->dev = dev; |