aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-11-13 19:07:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-13 21:14:14 -0500
commitfd9bc53b99a77aefe89d810d889aa6385565959b (patch)
tree4708580ff00b6c0acce085e3c402f6cd7fd8f311 /arch/um
parentc50d2c4d6685db9b45cf6521046296df5bc42592 (diff)
[PATCH] uml console channels: remove console_write wrappers
We were using a long series of (stupid) wrappers which all call generic_console_write(). Since the wrappers only change the 4th param, which is unused by the called proc, remove them and call generic_console_write() directly. If needed at any time in the future to reintroduce this stuff, the member could be moved to a generic struct, to avoid this duplicated handling. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/fd.c9
-rw-r--r--arch/um/drivers/port_user.c9
-rw-r--r--arch/um/drivers/pty.c11
-rw-r--r--arch/um/drivers/tty.c9
-rw-r--r--arch/um/drivers/xterm.c9
5 files changed, 6 insertions, 41 deletions
diff --git a/arch/um/drivers/fd.c b/arch/um/drivers/fd.c
index f0b888f66e05..3296e86a03a5 100644
--- a/arch/um/drivers/fd.c
+++ b/arch/um/drivers/fd.c
@@ -76,13 +76,6 @@ static void fd_close(int fd, void *d)
76 } 76 }
77} 77}
78 78
79static int fd_console_write(int fd, const char *buf, int n, void *d)
80{
81 struct fd_chan *data = d;
82
83 return(generic_console_write(fd, buf, n, &data->tt));
84}
85
86struct chan_ops fd_ops = { 79struct chan_ops fd_ops = {
87 .type = "fd", 80 .type = "fd",
88 .init = fd_init, 81 .init = fd_init,
@@ -90,7 +83,7 @@ struct chan_ops fd_ops = {
90 .close = fd_close, 83 .close = fd_close,
91 .read = generic_read, 84 .read = generic_read,
92 .write = generic_write, 85 .write = generic_write,
93 .console_write = fd_console_write, 86 .console_write = generic_console_write,
94 .window_size = generic_window_size, 87 .window_size = generic_window_size,
95 .free = generic_free, 88 .free = generic_free,
96 .winch = 1, 89 .winch = 1,
diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c
index ed4a1a6c5d83..c43e8bb32502 100644
--- a/arch/um/drivers/port_user.c
+++ b/arch/um/drivers/port_user.c
@@ -100,13 +100,6 @@ static void port_close(int fd, void *d)
100 os_close_file(fd); 100 os_close_file(fd);
101} 101}
102 102
103static int port_console_write(int fd, const char *buf, int n, void *d)
104{
105 struct port_chan *data = d;
106
107 return(generic_console_write(fd, buf, n, &data->tt));
108}
109
110struct chan_ops port_ops = { 103struct chan_ops port_ops = {
111 .type = "port", 104 .type = "port",
112 .init = port_init, 105 .init = port_init,
@@ -114,7 +107,7 @@ struct chan_ops port_ops = {
114 .close = port_close, 107 .close = port_close,
115 .read = generic_read, 108 .read = generic_read,
116 .write = generic_write, 109 .write = generic_write,
117 .console_write = port_console_write, 110 .console_write = generic_console_write,
118 .window_size = generic_window_size, 111 .window_size = generic_window_size,
119 .free = port_free, 112 .free = port_free,
120 .winch = 1, 113 .winch = 1,
diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c
index 0306a1b215b7..1c555c38de4d 100644
--- a/arch/um/drivers/pty.c
+++ b/arch/um/drivers/pty.c
@@ -118,13 +118,6 @@ static int pty_open(int input, int output, int primary, void *d,
118 return(fd); 118 return(fd);
119} 119}
120 120
121static int pty_console_write(int fd, const char *buf, int n, void *d)
122{
123 struct pty_chan *data = d;
124
125 return(generic_console_write(fd, buf, n, &data->tt));
126}
127
128struct chan_ops pty_ops = { 121struct chan_ops pty_ops = {
129 .type = "pty", 122 .type = "pty",
130 .init = pty_chan_init, 123 .init = pty_chan_init,
@@ -132,7 +125,7 @@ struct chan_ops pty_ops = {
132 .close = generic_close, 125 .close = generic_close,
133 .read = generic_read, 126 .read = generic_read,
134 .write = generic_write, 127 .write = generic_write,
135 .console_write = pty_console_write, 128 .console_write = generic_console_write,
136 .window_size = generic_window_size, 129 .window_size = generic_window_size,
137 .free = generic_free, 130 .free = generic_free,
138 .winch = 0, 131 .winch = 0,
@@ -145,7 +138,7 @@ struct chan_ops pts_ops = {
145 .close = generic_close, 138 .close = generic_close,
146 .read = generic_read, 139 .read = generic_read,
147 .write = generic_write, 140 .write = generic_write,
148 .console_write = pty_console_write, 141 .console_write = generic_console_write,
149 .window_size = generic_window_size, 142 .window_size = generic_window_size,
150 .free = generic_free, 143 .free = generic_free,
151 .winch = 0, 144 .winch = 0,
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c
index 6fbb670ee274..94c9265a4f2c 100644
--- a/arch/um/drivers/tty.c
+++ b/arch/um/drivers/tty.c
@@ -60,13 +60,6 @@ static int tty_open(int input, int output, int primary, void *d,
60 return(fd); 60 return(fd);
61} 61}
62 62
63static int tty_console_write(int fd, const char *buf, int n, void *d)
64{
65 struct tty_chan *data = d;
66
67 return(generic_console_write(fd, buf, n, &data->tt));
68}
69
70struct chan_ops tty_ops = { 63struct chan_ops tty_ops = {
71 .type = "tty", 64 .type = "tty",
72 .init = tty_chan_init, 65 .init = tty_chan_init,
@@ -74,7 +67,7 @@ struct chan_ops tty_ops = {
74 .close = generic_close, 67 .close = generic_close,
75 .read = generic_read, 68 .read = generic_read,
76 .write = generic_write, 69 .write = generic_write,
77 .console_write = tty_console_write, 70 .console_write = generic_console_write,
78 .window_size = generic_window_size, 71 .window_size = generic_window_size,
79 .free = generic_free, 72 .free = generic_free,
80 .winch = 0, 73 .winch = 0,
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
index b530f1a6540d..aaa636661043 100644
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -194,13 +194,6 @@ static void xterm_free(void *d)
194 free(d); 194 free(d);
195} 195}
196 196
197static int xterm_console_write(int fd, const char *buf, int n, void *d)
198{
199 struct xterm_chan *data = d;
200
201 return(generic_console_write(fd, buf, n, &data->tt));
202}
203
204struct chan_ops xterm_ops = { 197struct chan_ops xterm_ops = {
205 .type = "xterm", 198 .type = "xterm",
206 .init = xterm_init, 199 .init = xterm_init,
@@ -208,7 +201,7 @@ struct chan_ops xterm_ops = {
208 .close = xterm_close, 201 .close = xterm_close,
209 .read = generic_read, 202 .read = generic_read,
210 .write = generic_write, 203 .write = generic_write,
211 .console_write = xterm_console_write, 204 .console_write = generic_console_write,
212 .window_size = generic_window_size, 205 .window_size = generic_window_size,
213 .free = xterm_free, 206 .free = xterm_free,
214 .winch = 1, 207 .winch = 1,