diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-10 04:44:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:22 -0500 |
commit | a52f362f864f56238c9036f5c56f763a80e2ddd5 (patch) | |
tree | f9288fdfb8988a0ec31f052e89b3dfca1a632e4d /arch/um | |
parent | 99b0278f95fc9d55adf65133dc678167a88b632a (diff) |
[PATCH] uml: mostly const a structure
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>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/drivers/chan_kern.c | 5 | ||||
-rw-r--r-- | arch/um/drivers/ssl.c | 3 | ||||
-rw-r--r-- | arch/um/drivers/stdio_console.c | 3 | ||||
-rw-r--r-- | arch/um/include/chan_kern.h | 3 | ||||
-rw-r--r-- | arch/um/include/chan_user.h | 8 |
5 files changed, 11 insertions, 11 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index bce9b3427b09..7b8baf146acc 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -354,8 +354,7 @@ int console_write_chan(struct list_head *chans, const char *buf, int len) | |||
354 | return ret; | 354 | return ret; |
355 | } | 355 | } |
356 | 356 | ||
357 | int console_open_chan(struct line *line, struct console *co, | 357 | int console_open_chan(struct line *line, struct console *co) |
358 | const struct chan_opts *opts) | ||
359 | { | 358 | { |
360 | int err; | 359 | int err; |
361 | 360 | ||
@@ -363,7 +362,7 @@ int console_open_chan(struct line *line, struct console *co, | |||
363 | if(err) | 362 | if(err) |
364 | return err; | 363 | return err; |
365 | 364 | ||
366 | printk("Console initialized on /dev/%s%d\n",co->name,co->index); | 365 | printk("Console initialized on /dev/%s%d\n", co->name, co->index); |
367 | return 0; | 366 | return 0; |
368 | } | 367 | } |
369 | 368 | ||
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index fe400acc9751..475de52783e4 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -38,6 +38,7 @@ static void ssl_announce(char *dev_name, int dev) | |||
38 | dev_name); | 38 | dev_name); |
39 | } | 39 | } |
40 | 40 | ||
41 | /* Almost const, except that xterm_title may be changed in an initcall */ | ||
41 | static struct chan_opts opts = { | 42 | static struct chan_opts opts = { |
42 | .announce = ssl_announce, | 43 | .announce = ssl_announce, |
43 | .xterm_title = "Serial Line #%d", | 44 | .xterm_title = "Serial Line #%d", |
@@ -171,7 +172,7 @@ static int ssl_console_setup(struct console *co, char *options) | |||
171 | { | 172 | { |
172 | struct line *line = &serial_lines[co->index]; | 173 | struct line *line = &serial_lines[co->index]; |
173 | 174 | ||
174 | return console_open_chan(line, co, &opts); | 175 | return console_open_chan(line, co); |
175 | } | 176 | } |
176 | 177 | ||
177 | static struct console ssl_cons = { | 178 | static struct console ssl_cons = { |
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 0b1bca498049..a83c42c263b3 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -42,6 +42,7 @@ void stdio_announce(char *dev_name, int dev) | |||
42 | dev_name); | 42 | dev_name); |
43 | } | 43 | } |
44 | 44 | ||
45 | /* Almost const, except that xterm_title may be changed in an initcall */ | ||
45 | static struct chan_opts opts = { | 46 | static struct chan_opts opts = { |
46 | .announce = stdio_announce, | 47 | .announce = stdio_announce, |
47 | .xterm_title = "Virtual Console #%d", | 48 | .xterm_title = "Virtual Console #%d", |
@@ -144,7 +145,7 @@ static int uml_console_setup(struct console *co, char *options) | |||
144 | { | 145 | { |
145 | struct line *line = &vts[co->index]; | 146 | struct line *line = &vts[co->index]; |
146 | 147 | ||
147 | return console_open_chan(line, co, &opts); | 148 | return console_open_chan(line, co); |
148 | } | 149 | } |
149 | 150 | ||
150 | static struct console stdiocons = { | 151 | static struct console stdiocons = { |
diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index 2d9aa7ef4c27..c4b41bb1035f 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h | |||
@@ -36,8 +36,7 @@ extern int write_chan(struct list_head *chans, const char *buf, int len, | |||
36 | int write_irq); | 36 | int write_irq); |
37 | extern int console_write_chan(struct list_head *chans, const char *buf, | 37 | extern int console_write_chan(struct list_head *chans, const char *buf, |
38 | int len); | 38 | int len); |
39 | extern int console_open_chan(struct line *line, struct console *co, | 39 | extern int console_open_chan(struct line *line, struct console *co); |
40 | const struct chan_opts *opts); | ||
41 | extern void deactivate_chan(struct list_head *chans, int irq); | 40 | extern void deactivate_chan(struct list_head *chans, int irq); |
42 | extern void reactivate_chan(struct list_head *chans, int irq); | 41 | extern void reactivate_chan(struct list_head *chans, int irq); |
43 | extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); | 42 | extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); |
diff --git a/arch/um/include/chan_user.h b/arch/um/include/chan_user.h index a795547a1dbd..ad671eb9edeb 100644 --- a/arch/um/include/chan_user.h +++ b/arch/um/include/chan_user.h | |||
@@ -9,11 +9,11 @@ | |||
9 | #include "init.h" | 9 | #include "init.h" |
10 | 10 | ||
11 | struct chan_opts { | 11 | struct chan_opts { |
12 | void (*announce)(char *dev_name, int dev); | 12 | void (*const announce)(char *dev_name, int dev); |
13 | char *xterm_title; | 13 | char *xterm_title; |
14 | int raw; | 14 | const int raw; |
15 | unsigned long tramp_stack; | 15 | const unsigned long tramp_stack; |
16 | int in_kernel; | 16 | const int in_kernel; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE }; | 19 | enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE }; |