All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] genirq: Make - vs ?: precedence explicit
@ 2017-11-22 20:56 Kees Cook
  2017-11-23 19:13 ` [tip:irq/urgent] genirq/matrix: Make - vs ?: Precedence explicit tip-bot for Kees Cook
  2017-11-28 12:19 ` [PATCH] genirq: Make - vs ?: precedence explicit Rasmus Villemoes
  0 siblings, 2 replies; 4+ messages in thread
From: Kees Cook @ 2017-11-22 20:56 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel

Noticed with a Clang build. This improves the readability of the ?:
expression, as it has lower precedence than the - expression. Show
explicitly that - is evaluated first.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 kernel/irq/matrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/matrix.c b/kernel/irq/matrix.c
index a3cbbc8191c5..7df2480005f8 100644
--- a/kernel/irq/matrix.c
+++ b/kernel/irq/matrix.c
@@ -384,7 +384,7 @@ 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;
+	return (m->global_available - cpudown) ? cm->available : 0;
 }
 
 /**
-- 
2.7.4


-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-28 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 20:56 [PATCH] genirq: Make - vs ?: precedence explicit Kees Cook
2017-11-23 19:13 ` [tip:irq/urgent] genirq/matrix: Make - vs ?: Precedence explicit tip-bot for Kees Cook
2017-11-28 12:19 ` [PATCH] genirq: Make - vs ?: precedence explicit Rasmus Villemoes
2017-11-28 13:43   ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.