diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-02-28 15:34:49 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 14:35:17 -0800 |
commit | f5afe8064f3087bead8fea7e32547c2a3ada5fd0 (patch) | |
tree | de6a9d60aad6ee262c04290d73e414cd92b4ad5d /drivers/pci/hotplug/pciehp_core.c | |
parent | 7c8f25da12a3dda46fb730699582895d5fc51287 (diff) | |
download | blackbird-obmc-linux-f5afe8064f3087bead8fea7e32547c2a3ada5fd0.tar.gz blackbird-obmc-linux-f5afe8064f3087bead8fea7e32547c2a3ada5fd0.zip |
[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/pciehp_core.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 1e8506e0fd87..601cf9045b20 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c @@ -117,27 +117,23 @@ static int init_slots(struct controller *ctrl) slot_number = ctrl->first_slot; while (number_of_slots) { - slot = kmalloc(sizeof(*slot), GFP_KERNEL); + slot = kzalloc(sizeof(*slot), GFP_KERNEL); if (!slot) goto error; - memset(slot, 0, sizeof(struct slot)); slot->hotplug_slot = - kmalloc(sizeof(*(slot->hotplug_slot)), + kzalloc(sizeof(*(slot->hotplug_slot)), GFP_KERNEL); if (!slot->hotplug_slot) goto error_slot; hotplug_slot = slot->hotplug_slot; - memset(hotplug_slot, 0, sizeof(struct hotplug_slot)); hotplug_slot->info = - kmalloc(sizeof(*(hotplug_slot->info)), + kzalloc(sizeof(*(hotplug_slot->info)), GFP_KERNEL); if (!hotplug_slot->info) goto error_hpslot; hotplug_slot_info = hotplug_slot->info; - memset(hotplug_slot_info, 0, - sizeof(struct hotplug_slot_info)); hotplug_slot->name = kmalloc(SLOT_NAME_SIZE, GFP_KERNEL); if (!hotplug_slot->name) goto error_info; @@ -373,12 +369,11 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ u8 value; struct pci_dev *pdev; - ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL); + ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); if (!ctrl) { err("%s : out of memory\n", __FUNCTION__); goto err_out_none; } - memset(ctrl, 0, sizeof(struct controller)); pdev = dev->port; ctrl->pci_dev = pdev; |