Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1443365

[patch] s390/smp: clean up a condition

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [patch] s390/smp: clean up a condition
Date 2016-07-14 13:30 +0200
Message-ID <rUN06-BW-17@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


I can never remember precedence rules.  Let's add some parenthesis so
this code is more clear.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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++)

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[patch] s390/smp: clean up a condition Dan Carpenter <dan.carpenter@oracle.com> - 2016-07-14 13:30 +0200
  Re: [patch] s390/smp: clean up a condition Martin Schwidefsky <schwidefsky@de.ibm.com> - 2016-07-18 09:10 +0200

csiph-web