aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Perches <[email protected]>2015-05-20 05:44:54 -0700
committerRalf Baechle <[email protected]>2015-05-26 16:46:52 +0200
commit884e7e5e7d1a35b944436895852d5ed24e79d42e (patch)
tree69c2f68813eaf7c8815ad5c1dbffc2faacddca2a
parent70f041b6e1ff508750988ffd034ac6117d34d4d7 (diff)
MIPS: irq: Use DECLARE_BITMAP
Use the generic mechanism to declare a bitmap instead of unsigned long. This could fix an overwrite defect of whatever follows irq_map. Not all "#define NR_IRQS <value>" are a multiple of BITS_PER_LONG so using DECLARE_BITMAP allocates the proper number of longs required for the possible bits. For instance: arch/mips/include/asm/mach-ath79/irq.h:#define NR_IRQS 51 arch/mips/include/asm/mach-db1x00/irq.h:#define NR_IRQS 152 arch/mips/include/asm/mach-lantiq/falcon/irq.h:#define NR_IRQS 328 Signed-off-by: Joe Perches <[email protected]> Cc: linux-mips <[email protected]> Cc: LKML <[email protected]> Cc: Gabor Juhos <[email protected]> Cc: Manuel Lauss <[email protected]> Cc: John Crispin <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/10091/ Signed-off-by: Ralf Baechle <[email protected]>
-rw-r--r--arch/mips/kernel/irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index d2bfbc2e8995..51f57d841662 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -29,7 +29,7 @@
int kgdb_early_setup;
#endif
-static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
+static DECLARE_BITMAP(irq_map, NR_IRQS);
int allocate_irqno(void)
{