summaryrefslogtreecommitdiff
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-26 13:22:13 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-26 13:22:13 +0100
commit4434e5156409eb3ec98f5ad7f0a0c07ebafe970d (patch)
treec7f148cdae7a6cf4013253c6c2dbd1c49e837e32 /drivers/pci/msi.c
parent2b8f836fb196acede88b6cc772e9057e0a9c0223 (diff)
parent694593e3374a67d95ece6a275a1f181644c2c4d8 (diff)
Merge branches 'sched/cleanups', 'sched/urgent' and 'linus' into sched/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)