lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 30 Jun 2009 12:36:20 +0100
From:	"Jan Beulich" <JBeulich@...ell.com>
To:	"Rusty Russell" <rusty@...tcorp.com.au>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH] fix num_..._cpus() for non-SMP

After commit ae7a47e72e1a0b5e2b46d1596bc2c22942a73023, the type of
num_online_cpus() & Co differs between MP and UP builds, causing e.g.
uses of max()/min() to result in compilation issues.

Signed-off-by: Jan Beulich <jbeulich@...ell.com>

---
 include/linux/cpumask.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.31-rc1/include/linux/cpumask.h	2009-06-10 05:05:27.000000000 +0200
+++ 2.6.31-rc1-num_..._cpus-no-smp/include/linux/cpumask.h	2009-06-23 14:06:50.000000000 +0200
@@ -502,9 +502,9 @@ extern const struct cpumask *const cpu_a
 #define cpu_present(cpu)	cpumask_test_cpu((cpu), cpu_present_mask)
 #define cpu_active(cpu)		cpumask_test_cpu((cpu), cpu_active_mask)
 #else
-#define num_online_cpus()	1
-#define num_possible_cpus()	1
-#define num_present_cpus()	1
+#define num_online_cpus()	1U
+#define num_possible_cpus()	1U
+#define num_present_cpus()	1U
 #define cpu_online(cpu)		((cpu) == 0)
 #define cpu_possible(cpu)	((cpu) == 0)
 #define cpu_present(cpu)	((cpu) == 0)



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ