aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/acpiphp_glue.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-28 15:34:49 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 14:35:17 -0800
commitf5afe8064f3087bead8fea7e32547c2a3ada5fd0 (patch)
treede6a9d60aad6ee262c04290d73e414cd92b4ad5d /drivers/pci/hotplug/acpiphp_glue.c
parent7c8f25da12a3dda46fb730699582895d5fc51287 (diff)
[PATCH] PCI: kzalloc() conversion in drivers/pci
this patch converts drivers/pci to kzalloc usage. Compile tested with allyes config. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index cbd5893d198..c7e6387983d 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -143,10 +143,9 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
device = (adr >> 16) & 0xffff;
function = adr & 0xffff;
- newfunc = kmalloc(sizeof(struct acpiphp_func), GFP_KERNEL);
+ newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL);
if (!newfunc)
return AE_NO_MEMORY;
- memset(newfunc, 0, sizeof(struct acpiphp_func));
INIT_LIST_HEAD(&newfunc->sibling);
newfunc->handle = handle;
@@ -189,13 +188,12 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
}
if (!slot) {
- slot = kmalloc(sizeof(struct acpiphp_slot), GFP_KERNEL);
+ slot = kzalloc(sizeof(struct acpiphp_slot), GFP_KERNEL);
if (!slot) {
kfree(newfunc);
return AE_NO_MEMORY;
}
- memset(slot, 0, sizeof(struct acpiphp_slot));
slot->bridge = bridge;
slot->device = device;
slot->sun = sun;
@@ -376,12 +374,10 @@ static void add_host_bridge(acpi_handle *handle, struct pci_bus *pci_bus)
{
struct acpiphp_bridge *bridge;
- bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
+ bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
if (bridge == NULL)
return;
- memset(bridge, 0, sizeof(struct acpiphp_bridge));
-
bridge->type = BRIDGE_TYPE_HOST;
bridge->handle = handle;
@@ -398,14 +394,12 @@ static void add_p2p_bridge(acpi_handle *handle, struct pci_dev *pci_dev)
{
struct acpiphp_bridge *bridge;
- bridge = kmalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
+ bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
if (bridge == NULL) {
err("out of memory\n");
return;
}
- memset(bridge, 0, sizeof(struct acpiphp_bridge));
-
bridge->type = BRIDGE_TYPE_P2P;
bridge->handle = handle;