diff options
author | Gavin Shan <shangw@linux.vnet.ibm.com> | 2012-09-08 00:44:03 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-09-10 01:35:28 +0200 |
commit | 7e4bbaf0bf13c33be275e8a17997597dfd0ed03a (patch) | |
tree | 73fce92616db41e744b45a817da40d727b79ea1c /arch/powerpc | |
parent | powerpc/eeh: Move EEH initialization around (diff) | |
download | linux-7e4bbaf0bf13c33be275e8a17997597dfd0ed03a.tar.xz linux-7e4bbaf0bf13c33be275e8a17997597dfd0ed03a.zip |
powerpc/eeh: Use slab to allocate eeh devices
The EEH initialization functions have been postponed until slab/slub
are ready. So we use slab/slub to allocate the memory chunks for newly
creatd EEH devices. That would save lots of memory.
The patch also does cleanup to replace "kmalloc" with "kzalloc" so
that we needn't clear the allocated memory chunk explicitly.
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_cache.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_dev.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_event.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c index e5ae1c687c66..f50b717286fb 100644 --- a/arch/powerpc/platforms/pseries/eeh_cache.c +++ b/arch/powerpc/platforms/pseries/eeh_cache.c @@ -151,7 +151,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo, return piar; } } - piar = kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC); + piar = kzalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC); if (!piar) return NULL; diff --git a/arch/powerpc/platforms/pseries/eeh_dev.c b/arch/powerpc/platforms/pseries/eeh_dev.c index ab68c5910f9f..8e3443b260e4 100644 --- a/arch/powerpc/platforms/pseries/eeh_dev.c +++ b/arch/powerpc/platforms/pseries/eeh_dev.c @@ -55,7 +55,7 @@ void * __devinit eeh_dev_init(struct device_node *dn, void *data) struct eeh_dev *edev; /* Allocate EEH device */ - edev = zalloc_maybe_bootmem(sizeof(*edev), GFP_KERNEL); + edev = kzalloc(sizeof(*edev), GFP_KERNEL); if (!edev) { pr_warning("%s: out of memory\n", __func__); return NULL; diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index fb506317ebb0..61327722b4fc 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c @@ -139,7 +139,7 @@ int eeh_send_failure_event(struct eeh_dev *edev) printk(KERN_ERR "EEH: PCI location = %s\n", location); return 1; } - event = kmalloc(sizeof(*event), GFP_ATOMIC); + event = kzalloc(sizeof(*event), GFP_ATOMIC); if (event == NULL) { printk(KERN_ERR "EEH: out of memory, event not handled\n"); return 1; |