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>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 27 Jan 2010 21:24:25 +0100
From:	John Kacur <jkacur@...hat.com>
To:	Clark Williams <williams@...hat.com>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	lkml <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Carsten Emde <C.Emde@...dl.org>,
	rt-users <linux-rt-users@...r.kernel.org>,
	John Kacur <jkacur@...hat.com>
Subject: [PATCH 2/5] rt-tests: Separate the #ifdef LIBNUMA_API_VERSION functions.

Separate the #ifdef LIBNUMA_API_VERSION of function rt_numa_numa_node_of_cpu,
it is slightly cleaner this way.

Signed-off-by: John Kacur <jkacur@...hat.com>
---
 src/cyclictest/rt_numa.h |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h
index 14837ff..8d44097 100644
--- a/src/cyclictest/rt_numa.h
+++ b/src/cyclictest/rt_numa.h
@@ -58,15 +58,20 @@ static void numa_on_and_available()
 		fatal("--numa specified and numa functions not available.\n");
 }
 
+#if LIBNUMA_API_VERSION >= 2
 static int rt_numa_numa_node_of_cpu(int cpu)
 {
-#if LIBNUMA_API_VERSION >= 2
 	int node;
 	node = numa_node_of_cpu(cpu);
 	if (node == -1)
 		fatal("invalid cpu passed to numa_node_of_cpu(%d)\n", cpu);
 	return node;
-#else
+}
+
+#else	/* LIBNUMA_API_VERSION == 1 */
+
+static int rt_numa_numa_node_of_cpu(int cpu)
+{
 	unsigned char cpumask[16];
         int node, ret, idx, bit;
 	int max_node, max_cpus;
@@ -96,10 +101,10 @@ static int rt_numa_numa_node_of_cpu(int cpu)
         errno = EINVAL;
 end:
         return ret;
-
-#endif
 }
 
+#endif	/* LIBNUMA_API_VERSION */
+
 static void *rt_numa_numa_alloc_onnode(size_t size, int node, int cpu)
 {
 	void *stack;
-- 
1.6.6

--
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