Skip to content

Commit

Permalink
genirq/matrix: Fix the precedence fix for real
Browse files Browse the repository at this point in the history
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: 75f1133 ("genirq/matrix: Make - vs ?: Precedence explicit")
Reported-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Kees Cook <[email protected]>
  • Loading branch information
KAGA-KOKO committed Dec 4, 2017
1 parent ae64f9b commit bb5c434
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/irq/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit bb5c434

Please sign in to comment.