diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-01-25 20:02:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:11 -0500 |
commit | 57c95c0d1c9ec83877dfea2f62bebf31059bc93c (patch) | |
tree | 864e89551bb003665192973b5d3c6831cc478f95 /drivers/pci/hotplug/shpchp_hpc.c | |
parent | 287588b3537d0ce56a83f54d0e6ffcd60e54b569 (diff) |
[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.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c index c32a1b16704f..1a6b5448f81d 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) | |||
1390 | ctrl->pci_dev = pdev; /* pci_dev of the P2P bridge */ | 1390 | ctrl->pci_dev = pdev; /* pci_dev of the P2P bridge */ |
1391 | 1391 | ||
1392 | spin_lock_init(&list_lock); | 1392 | spin_lock_init(&list_lock); |
1393 | php_ctlr = (struct php_ctlr_state_s *) kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL); | 1393 | php_ctlr = kzalloc(sizeof(*php_ctlr), GFP_KERNEL); |
1394 | 1394 | ||
1395 | if (!php_ctlr) { /* allocate controller state data */ | 1395 | if (!php_ctlr) { /* allocate controller state data */ |
1396 | err("%s: HPC controller memory allocation error!\n", __FUNCTION__); | 1396 | err("%s: HPC controller memory allocation error!\n", __FUNCTION__); |
1397 | goto abort; | 1397 | goto abort; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | memset(php_ctlr, 0, sizeof(struct php_ctlr_state_s)); | ||
1401 | |||
1402 | php_ctlr->pci_dev = pdev; /* save pci_dev in context */ | 1400 | php_ctlr->pci_dev = pdev; /* save pci_dev in context */ |
1403 | 1401 | ||
1404 | if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device == | 1402 | if ((pdev->vendor == PCI_VENDOR_ID_AMD) || (pdev->device == |