summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-11-15 14:15:07 -0800
committerThomas Gleixner <tglx@linutronix.de>2013-11-19 19:06:41 +0100
commit6bab2c613d7fa70bb8514f89ab7455ede717142b (patch)
tree444873d38abef1005be025a7ae2962d0ba52818e /include/linux
parent00d1a39e69d5afa7523dad515a05b21abd17c389 (diff)
genirq: Correct fuzzy and fragile IRQ_RETVAL() definition
commit bedd30d986a0 ("genirq: make irqreturn_t an enum") blindly replaced "0" by "IRQ_NONE" in the "IRQ_RETVAL(x)" macro definition. However, as "x" is a condition, "0" meant "boolean false", not an irqreturn_t value. All of this worked, and kept working after the addition of IRQ_WAKE_THREAD, as - both "boolean false" and "IRQ_NONE" are "0" (for the comparison), - "boolean true" and "boolean false" nicely map to the correct values of "IRQ_HANDLED" and "IRQ_NONE" (for the return value). Correct the macro definition for clarity and future-proofness. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/irqreturn.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
index 714ba08dc092..e374e369fb2f 100644
--- a/include/linux/irqreturn.h
+++ b/include/linux/irqreturn.h
@@ -14,6 +14,6 @@ enum irqreturn {
};
typedef enum irqreturn irqreturn_t;
-#define IRQ_RETVAL(x) ((x) != IRQ_NONE)
+#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE)
#endif