Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362795
b: refs/heads/master
c: ea79378
h: refs/heads/master
i:
  362793: e9f05e0
  362791: 1cb5f70
v: v3
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Apr 17, 2013
1 parent 4a333c0 commit 6a53504
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd9e034ef340e3a00301f67b00a247617891f1f0
refs/heads/master: ea793788f8ec868e655920f4726b2bd6a881e5ae
10 changes: 6 additions & 4 deletions trunk/arch/s390/pci/pci_msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6a53504

Please sign in to comment.