[PATCH] asm-generic: hard_irqs: handle NR_IRQS > 256 automatically

From: Mike Frysinger
Date: Sat Jun 13 2009 - 10:31:36 EST


If we're going to automatically set HARDIRQ_BITS for the arch, might as
well be a little bit smart about it and set it to 9 automatically if
NR_IRQS is larger than 8 bits.

Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
include/asm-generic/hardirq.h | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h
index 3d5d2c9..d93acec 100644
--- a/include/asm-generic/hardirq.h
+++ b/include/asm-generic/hardirq.h
@@ -12,7 +12,11 @@ typedef struct {
#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */

#ifndef HARDIRQ_BITS
-#define HARDIRQ_BITS 8
+# if NR_IRQS > 256
+# define HARDIRQ_BITS 9
+# else
+# define HARDIRQ_BITS 8
+# endif
#endif

/*
--
1.6.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/