From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525AbdKVU4v (ORCPT ); Wed, 22 Nov 2017 15:56:51 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:39891 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbdKVU4t (ORCPT ); Wed, 22 Nov 2017 15:56:49 -0500 X-Google-Smtp-Source: AGs4zMYbJkbDylIRKn2tTwY2AAZmHh+c1zps0xJkIGE4ueZXE+s+RvfAafKfVvNQi8dNuT2gEIEmFQ== Date: Wed, 22 Nov 2017 12:56:45 -0800 From: Kees Cook To: Thomas Gleixner Cc: linux-kernel@vger.kernel.org Subject: [PATCH] genirq: Make - vs ?: precedence explicit Message-ID: <20171122205645.GA27125@beast> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Kees Cook --- 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