[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1432125894.2870.284.camel@perches.com>
Date: Wed, 20 May 2015 05:44:54 -0700
From: Joe Perches <joe@...ches.com>
To: Ralf Baechle <ralf@...ux-mips.org>
Cc: linux-mips <linux-mips@...ux-mips.org>,
LKML <linux-kernel@...r.kernel.org>,
Gabor Juhos <juhosg@...nwrt.org>,
Manuel Lauss <manuel.lauss@...glemail.com>,
John Crispin <blogic@...nwrt.org>
Subject: [PATCH] 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 <joe@...ches.com>
---
arch/mips/kernel/irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index d2bfbc2..51f57d8 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)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists