From 6a5350488b2979e0f7918edd96837cf9c6b07dff Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Tue, 16 Apr 2013 14:05:47 +0200 Subject: [PATCH] --- yaml --- r: 362795 b: refs/heads/master c: ea793788f8ec868e655920f4726b2bd6a881e5ae h: refs/heads/master i: 362793: e9f05e0d1a7424a7cc4a2e546d1b54e3f929cb00 362791: 1cb5f709cfe10e3fefcf075314c9fcc109e1854f v: v3 --- [refs] | 2 +- trunk/arch/s390/pci/pci_msi.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 10d508e9a241..e4c0be6fbdc7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd9e034ef340e3a00301f67b00a247617891f1f0 +refs/heads/master: ea793788f8ec868e655920f4726b2bd6a881e5ae diff --git a/trunk/arch/s390/pci/pci_msi.c b/trunk/arch/s390/pci/pci_msi.c index 0297931335e1..b097aed05a9b 100644 --- a/trunk/arch/s390/pci/pci_msi.c +++ b/trunk/arch/s390/pci/pci_msi.c @@ -18,8 +18,9 @@ /* mapping of irq numbers to msi_desc */ static struct hlist_head *msi_hash; -static unsigned int msihash_shift = 6; -#define msi_hashfn(nr) hash_long(nr, msihash_shift) +static const unsigned int msi_hash_bits = 8; +#define MSI_HASH_BUCKETS (1U << msi_hash_bits) +#define msi_hashfn(nr) hash_long(nr, msi_hash_bits) static DEFINE_SPINLOCK(msi_map_lock); @@ -74,6 +75,7 @@ int zpci_setup_msi_irq(struct zpci_dev *zdev, struct msi_desc *msi, map->irq = nr; map->msi = msi; zdev->msi_map[nr & ZPCI_MSI_MASK] = map; + INIT_HLIST_NODE(&map->msi_chain); pr_debug("%s hashing irq: %u to bucket nr: %llu\n", __func__, nr, msi_hashfn(nr)); @@ -125,11 +127,11 @@ int __init zpci_msihash_init(void) { unsigned int i; - msi_hash = kmalloc(256 * sizeof(*msi_hash), GFP_KERNEL); + msi_hash = kmalloc(MSI_HASH_BUCKETS * sizeof(*msi_hash), GFP_KERNEL); if (!msi_hash) return -ENOMEM; - for (i = 0; i < (1U << msihash_shift); i++) + for (i = 0; i < MSI_HASH_BUCKETS; i++) INIT_HLIST_HEAD(&msi_hash[i]); return 0; }