]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
genirq/matrix: Fix the precedence fix for real
authorThomas Gleixner <tglx@linutronix.de>
Tue, 28 Nov 2017 14:40:33 +0000 (15:40 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 4 Dec 2017 19:50:35 +0000 (20:50 +0100)
The previous commit which made the operator precedence in
irq_matrix_available() explicit made the implicit brokenness explicitely
wrong. It was wrong in the original commit already. The overworked
maintainer did not notice it either when merging the patch.

Replace the confusing '?' construct by a simple and obvious if ().

Fixes: 75f1133873d6 ("genirq/matrix: Make - vs ?: Precedence explicit")
Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Kees Cook <keescook@chromium.org>
kernel/irq/matrix.c

index 7df2480005f863693f20d5450515d85085c225b6..0ba0dd8863a779f5b318ef07f03c2915ea57cd57 100644 (file)
@@ -384,7 +384,9 @@ unsigned int irq_matrix_available(struct irq_matrix *m, bool cpudown)
 {
        struct cpumap *cm = this_cpu_ptr(m->maps);
 
-       return (m->global_available - cpudown) ? cm->available : 0;
+       if (!cpudown)
+               return m->global_available;
+       return m->global_available - cm->available;
 }
 
 /**