summaryrefslogtreecommitdiff
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-20 17:40:43 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-20 17:40:43 +0100
commit3b6f7b9beb553ea71a6d4d76ba82cf32eb6dadd2 (patch)
tree2cd8a8d61f350aa3b00e6b0afc998544923f183e /drivers/pci/msi.c
parent9be1b56a3e718aa998772019c57c398dbb19e258 (diff)
parent07a66d7c53a538e1a9759954a82bb6c07365eff9 (diff)
Merge branch 'x86/urgent' into x86/core
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 44f15ff70c1d..baba2eb5367d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -103,14 +103,12 @@ static void msix_set_enable(struct pci_dev *dev, int enable)
}
}
-/*
- * Essentially, this is ((1 << (1 << x)) - 1), but without the
- * undefinedness of a << 32.
- */
static inline __attribute_const__ u32 msi_mask(unsigned x)
{
- static const u32 mask[] = { 1, 2, 4, 0xf, 0xff, 0xffff, 0xffffffff };
- return mask[x];
+ /* Don't shift by >= width of type */
+ if (x >= 5)
+ return 0xffffffff;
+ return (1 << (1 << x)) - 1;
}
static void msix_flush_writes(struct irq_desc *desc)