The chan_opts structure is mostly const, and needs no locking.
Comment the lack of locking on the one field that can change.
Make all the other fields const.
It turned out that console_open_chan didn't use its chan_opts
argument, so that is deleted from the function and its callers.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
--
arch/um/drivers/chan_kern.c | 5 ++---
arch/um/drivers/ssl.c | 3 ++-
arch/um/drivers/stdio_console.c | 3 ++-
arch/um/include/chan_kern.h | 3 +--
arch/um/include/chan_user.h | 8 ++++----
5 files changed, 11 insertions(+), 11 deletions(-)
Index: linux-2.6.18-mm/arch/um/drivers/chan_kern.c
===================================================================
--- linux-2.6.18-mm.orig/arch/um/drivers/chan_kern.c 2006-12-29 18:21:46.000000000 -0500
+++ linux-2.6.18-mm/arch/um/drivers/chan_kern.c 2007-01-01 13:20:04.000000000 -0500
@@ -354,8 +354,7 @@ int console_write_chan(struct list_head
return ret;
}
-int console_open_chan(struct line *line, struct console *co,
- const struct chan_opts *opts)
+int console_open_chan(struct line *line, struct console *co)
{
int err;
@@ -363,7 +362,7 @@ int console_open_chan(struct line *line,
if(err)
return err;
- printk("Console initialized on /dev/%s%d\n",co->name,co->index);
+ printk("Console initialized on /dev/%s%d\n", co->name, co->index);
return 0;
}
Index: linux-2.6.18-mm/arch/um/drivers/ssl.c
===================================================================
--- linux-2.6.18-mm.orig/arch/um/drivers/ssl.c 2007-01-01 12:18:42.000000000 -0500
+++ linux-2.6.18-mm/arch/um/drivers/ssl.c 2007-01-01 13:20:25.000000000 -0500
@@ -38,6 +38,7 @@ static void ssl_announce(char *dev_name,
dev_name);
}
+/* Almost const, except that xterm_title may be changed in an initcall */
static struct chan_opts opts = {
.announce = ssl_announce,
.xterm_title = "Serial Line #%d",
@@ -171,7 +172,7 @@ static int ssl_console_...