[PATCH 6/8] UML - make two variables static

Previous thread: [PATCH 2/8] UML - watchdog driver formatting by Jeff Dike on Monday, January 1, 2007 - 3:47 pm. (5 messages)

Next thread: [PATCH 5/8] UML - mconsole locking by Jeff Dike on Monday, January 1, 2007 - 3:47 pm. (2 messages)
To: <akpm@...>
Cc: <linux-kernel@...>, <user-mode-linux-devel@...>
Date: Monday, January 1, 2007 - 3:47 pm

Make a couple of variables static.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
--
arch/um/drivers/port_kern.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.18-mm/arch/um/drivers/port_kern.c
===================================================================
--- linux-2.6.18-mm.orig/arch/um/drivers/port_kern.c 2007-01-01 11:32:22.000000000 -0500
+++ linux-2.6.18-mm/arch/um/drivers/port_kern.c 2007-01-01 12:03:54.000000000 -0500
@@ -129,8 +129,8 @@ static int port_accept(struct port_list
return(ret);
}

-DECLARE_MUTEX(ports_sem);
-struct list_head ports = LIST_HEAD_INIT(ports);
+static DECLARE_MUTEX(ports_sem);
+static struct list_head ports = LIST_HEAD_INIT(ports);

void port_work_proc(struct work_struct *unused)
{

-

To: <linux-kernel@...>
Cc: <akpm@...>, Christoph Lameter <cl@...>
Date: Wednesday, December 31, 1969 - 8:00 pm

Now we have a decent implementation it makes sense to have an
interface for "this cpu", analogous to __get_cpu_var.

Alpha is untested.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Lameter <cl@linux-foundation.org>
---
arch/alpha/include/asm/percpu.h | 10 ++++++++++
include/asm-generic/percpu.h | 11 +++++++++++
include/linux/percpu.h | 16 ++++++++++++++++
3 files changed, 37 insertions(+)

diff -r 0fb05e4271a6 arch/alpha/include/asm/percpu.h
--- a/arch/alpha/include/asm/percpu.h Mon Nov 17 22:19:40 2008 +1030
+++ b/arch/alpha/include/asm/percpu.h Mon Nov 17 22:21:09 2008 +1030
@@ -62,8 +62,16 @@
(*SHIFT_PERCPU_PTR(var, my_cpu_offset))
#define __raw_get_cpu_var(var) \
(*SHIFT_PERCPU_PTR(var, __my_cpu_offset))
+#define __get_cpu_ptr(ptr) \
+ RELOC_HIDE(ptr, my_cpu_offset)
+#define __raw_get_cpu_ptr(ptr) \
+ RELOC_HIDE(ptr, __my_cpu_offset)
#define per_cpu_ptr(ptr, cpu) \
RELOC_HIDE((ptr), (per_cpu_offset(cpu)))
+#define __get_cpu_ptr(ptr) \
+ RELOC_HIDE(ptr, my_cpu_offset)
+#define __raw_get_cpu_ptr(ptr) \
+ RELOC_HIDE(ptr, __my_cpu_offset)

#else /* ! SMP */

@@ -71,6 +79,8 @@
#define __get_cpu_var(var) per_cpu_var(var)
#define __raw_get_cpu_var(var) per_cpu_var(var)
#define per_cpu_ptr(ptr, cpu) (ptr)
+#define __get_cpu_ptr(ptr) (ptr)
+#define __raw_get_cpu_ptr(ptr) (ptr)

#define PER_CPU_ATTRIBUTES

diff -r 0fb05e4271a6 include/asm-generic/percpu.h
--- a/include/asm-generic/percpu.h Mon Nov 17 22:19:40 2008 +1030
+++ b/include/asm-generic/percpu.h Mon Nov 17 22:21:09 2008 +1030
@@ -72,6 +72,15 @@
#define per_cpu_ptr(ptr, cpu) \
RELOC_HIDE((ptr), (per_cpu_offset(cpu)))

+/**
+ * __get_cpu_ptr - get a pointer to this cpu's allocated memory
+ * @ptr: the pointer returned from alloc_percpu
+ *
+ * Similar to __get_cpu_var(), except for dynamic memory.
+ */
+#define __get_cpu_ptr(ptr) RELOC_HIDE(ptr, my_cpu_offset)
+#define __raw_get_cpu_ptr(ptr) RELOC_HIDE(ptr, __my_cpu_offset)...

Previous thread: [PATCH 2/8] UML - watchdog driver formatting by Jeff Dike on Monday, January 1, 2007 - 3:47 pm. (5 messages)

Next thread: [PATCH 5/8] UML - mconsole locking by Jeff Dike on Monday, January 1, 2007 - 3:47 pm. (2 messages)