From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275AbcGNLYO (ORCPT ); Thu, 14 Jul 2016 07:24:14 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:49802 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbcGNLYN (ORCPT ); Thu, 14 Jul 2016 07:24:13 -0400 Date: Thu, 14 Jul 2016 13:40:22 +0300 From: Dan Carpenter To: Martin Schwidefsky Cc: Heiko Carstens , Michael Holzheu , Thomas Gleixner , Hendrik Brueckner , "Peter Zijlstra (Intel)" , Christian Borntraeger , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] s390/smp: clean up a condition Message-ID: <20160714104022.GF18175@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I can never remember precedence rules. Let's add some parenthesis so this code is more clear. Signed-off-by: Dan Carpenter --- The original code is correct right? We didn't intend to say: sclp_max = sclp.max_cores * (sclp_max ?: nr_cpu_ids); diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 5c8f7ca..35531fe 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -887,7 +887,7 @@ void __init smp_fill_possible_mask(void) sclp_max = max(sclp.mtid, sclp.mtid_cp) + 1; sclp_max = min(smp_max_threads, sclp_max); - sclp_max = sclp.max_cores * sclp_max ?: nr_cpu_ids; + sclp_max = (sclp.max_cores * sclp_max) ?: nr_cpu_ids; possible = setup_possible_cpus ?: nr_cpu_ids; possible = min(possible, sclp_max); for (cpu = 0; cpu < possible && cpu < nr_cpu_ids; cpu++)