aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/msi.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 008235947aa4..27a057409eca 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -45,16 +45,10 @@ msi_register(struct msi_ops *ops)
45 return 0; 45 return 0;
46} 46}
47 47
48static void msi_cache_ctor(void *p, kmem_cache_t *cache, unsigned long flags)
49{
50 memset(p, 0, sizeof(struct msi_desc));
51}
52
53static int msi_cache_init(void) 48static int msi_cache_init(void)
54{ 49{
55 msi_cachep = kmem_cache_create("msi_cache", 50 msi_cachep = kmem_cache_create("msi_cache", sizeof(struct msi_desc),
56 sizeof(struct msi_desc), 51 0, SLAB_HWCACHE_ALIGN, NULL, NULL);
57 0, SLAB_HWCACHE_ALIGN, msi_cache_ctor, NULL);
58 if (!msi_cachep) 52 if (!msi_cachep)
59 return -ENOMEM; 53 return -ENOMEM;
60 54
@@ -402,11 +396,10 @@ static struct msi_desc* alloc_msi_entry(void)
402{ 396{
403 struct msi_desc *entry; 397 struct msi_desc *entry;
404 398
405 entry = kmem_cache_alloc(msi_cachep, SLAB_KERNEL); 399 entry = kmem_cache_zalloc(msi_cachep, GFP_KERNEL);
406 if (!entry) 400 if (!entry)
407 return NULL; 401 return NULL;
408 402
409 memset(entry, 0, sizeof(struct msi_desc));
410 entry->link.tail = entry->link.head = 0; /* single message */ 403 entry->link.tail = entry->link.head = 0; /* single message */
411 entry->dev = NULL; 404 entry->dev = NULL;
412 405