summaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/shpchp_hpc.c
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-01-26 10:02:41 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 14:35:11 -0800
commit57c95c0d1c9ec83877dfea2f62bebf31059bc93c (patch)
tree864e89551bb003665192973b5d3c6831cc478f95 /drivers/pci/hotplug/shpchp_hpc.c
parent287588b3537d0ce56a83f54d0e6ffcd60e54b569 (diff)
downloadop-kernel-dev-57c95c0d1c9ec83877dfea2f62bebf31059bc93c.zip
op-kernel-dev-57c95c0d1c9ec83877dfea2f62bebf31059bc93c.tar.gz
[PATCH] shpchp - replace kmalloc() with kzalloc() and cleanup arg of sizeof()
This patch replaces kmalloc() and memset() pair with kzalloc() and cleans up the arg of sizeof() in SHPCHP driver. Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_hpc.c')
-rw-r--r--drivers/pci/hotplug/shpchp_hpc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index c32a1b1..1a6b544 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -1390,15 +1390,13 @@ int shpc_init(struct controller * ctrl, struct pci_dev * pdev)
ctrl->pci_dev = pdev; /* pci_dev of the P2P bridge */
spin_lock_init(&list_lock);
- php_ctlr = (struct php_ctlr_state_s *) kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL);
+ php_ctlr = kzalloc(sizeof(*php_ctlr), GFP_KERNEL);
if (!php_ctlr) { /* allocate controller state data */
err("%s: HPC controller memory allocation error!\n", __FUNCTION__);
goto abort;
}
- memset(php_ctlr, 0, sizeof(struct php_ctlr_state_s));
-
php_ctlr->pci_dev = pdev; /* save pci_dev in context */
if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device ==
OpenPOWER on IntegriCloud