Thread (1 message) 1 message, 1 author, 2007-08-09
STALE6940d

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v2 [diff vs current]

[PATCH 3/5 -v2] Remove __pa() use in hvc_lguest

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2007-08-09 04:36:29
Subsystem: char and misc drivers, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Linus Torvalds

The hvc_lguest uses __pa in the const initialization.
In some architectures, __pa() is not constant so this fails in compiles.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/char/hvc_lguest.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/char/hvc_lguest.c b/drivers/char/hvc_lguest.c
index feeccba..c7d7d4c 100644
--- a/drivers/char/hvc_lguest.c
+++ b/drivers/char/hvc_lguest.c
@@ -42,7 +42,6 @@
  * use of physical address for the buffer itself. */
 static char inbuf[256];
 static struct lguest_dma cons_input = { .used_len = 0,
-					.addr[0] = __pa(inbuf),
 					.len[0] = sizeof(inbuf),
 					.len[1] = 0 };
 
@@ -114,6 +113,13 @@ static struct hv_ops lguest_cons = {
  * (0), and the struct hv_ops containing the put_chars() function. */
 static int __init cons_init(void)
 {
+	/*
+	 * We can't initialize using __pa in const declarations,
+	 * since __pa(inbuf) does not evaluate into a constant on
+	 * all architectures (namely x86_64).
+	 */
+	cons_input.addr[0] = __pa(inbuf);
+
 	if (strcmp(paravirt_ops.name, "lguest") != 0)
 		return 0;
 
-- 
1.4.4.4

-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help