diff options
author | Pekka J Enberg <penberg@cs.Helsinki.FI> | 2006-09-27 01:51:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-27 08:26:19 -0700 |
commit | 571817849c76aabf34d534c905b5e604f2e824c5 (patch) | |
tree | 5541946f87861b66e2612e623edccf81b8f42c70 | |
parent | 7583ddfd3aae1007bc4fc67ea4c07d573d376e9e (diff) | |
download | kernel_samsung_smdk4412-571817849c76aabf34d534c905b5e604f2e824c5.tar.gz kernel_samsung_smdk4412-571817849c76aabf34d534c905b5e604f2e824c5.tar.bz2 kernel_samsung_smdk4412-571817849c76aabf34d534c905b5e604f2e824c5.zip |
[PATCH] msi: use kmem_cache_zalloc()
Simpler, cleaner.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/pci/msi.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 008235947aa..27a057409ec 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -45,16 +45,10 @@ msi_register(struct msi_ops *ops) return 0; } -static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags) -{ - memset(p, 0, sizeof(struct msi_desc)); -} - static int msi_cache_init(void) { - msi_cachep = kmem_cache_create("msi_cache", - sizeof(struct msi_desc), - 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL); + msi_cachep = kmem_cache_create("msi_cache", sizeof(struct msi_desc), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); if (!msi_cachep) return -ENOMEM; @@ -402,11 +396,10 @@ static struct msi_desc* alloc_msi_entry(void) { struct msi_desc *entry; - entry = kmem_cache_alloc(msi_cachep, SLAB_KERNEL); + entry = kmem_cache_zalloc(msi_cachep, GFP_KERNEL); if (!entry) return NULL; - memset(entry, 0, sizeof(struct msi_desc)); entry->link.tail = entry->link.head = 0; /* single message */ entry->dev = NULL; |