Commit fd9bc53b authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds

[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: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c50d2c4d
...@@ -76,13 +76,6 @@ static void fd_close(int fd, void *d) ...@@ -76,13 +76,6 @@ static void fd_close(int fd, void *d)
} }
} }
static int fd_console_write(int fd, const char *buf, int n, void *d)
{
struct fd_chan *data = d;
return(generic_console_write(fd, buf, n, &data->tt));
}
struct chan_ops fd_ops = { struct chan_ops fd_ops = {
.type = "fd", .type = "fd",
.init = fd_init, .init = fd_init,
...@@ -90,7 +83,7 @@ struct chan_ops fd_ops = { ...@@ -90,7 +83,7 @@ struct chan_ops fd_ops = {
.close = fd_close, .close = fd_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = fd_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = generic_free, .free = generic_free,
.winch = 1, .winch = 1,
......
...@@ -100,13 +100,6 @@ static void port_close(int fd, void *d) ...@@ -100,13 +100,6 @@ static void port_close(int fd, void *d)
os_close_file(fd); os_close_file(fd);
} }
static int port_console_write(int fd, const char *buf, int n, void *d)
{
struct port_chan *data = d;
return(generic_console_write(fd, buf, n, &data->tt));
}
struct chan_ops port_ops = { struct chan_ops port_ops = {
.type = "port", .type = "port",
.init = port_init, .init = port_init,
...@@ -114,7 +107,7 @@ struct chan_ops port_ops = { ...@@ -114,7 +107,7 @@ struct chan_ops port_ops = {
.close = port_close, .close = port_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = port_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = port_free, .free = port_free,
.winch = 1, .winch = 1,
......
...@@ -118,13 +118,6 @@ static int pty_open(int input, int output, int primary, void *d, ...@@ -118,13 +118,6 @@ static int pty_open(int input, int output, int primary, void *d,
return(fd); return(fd);
} }
static int pty_console_write(int fd, const char *buf, int n, void *d)
{
struct pty_chan *data = d;
return(generic_console_write(fd, buf, n, &data->tt));
}
struct chan_ops pty_ops = { struct chan_ops pty_ops = {
.type = "pty", .type = "pty",
.init = pty_chan_init, .init = pty_chan_init,
...@@ -132,7 +125,7 @@ struct chan_ops pty_ops = { ...@@ -132,7 +125,7 @@ struct chan_ops pty_ops = {
.close = generic_close, .close = generic_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = pty_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = generic_free, .free = generic_free,
.winch = 0, .winch = 0,
...@@ -145,7 +138,7 @@ struct chan_ops pts_ops = { ...@@ -145,7 +138,7 @@ struct chan_ops pts_ops = {
.close = generic_close, .close = generic_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = pty_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = generic_free, .free = generic_free,
.winch = 0, .winch = 0,
......
...@@ -60,13 +60,6 @@ static int tty_open(int input, int output, int primary, void *d, ...@@ -60,13 +60,6 @@ static int tty_open(int input, int output, int primary, void *d,
return(fd); return(fd);
} }
static int tty_console_write(int fd, const char *buf, int n, void *d)
{
struct tty_chan *data = d;
return(generic_console_write(fd, buf, n, &data->tt));
}
struct chan_ops tty_ops = { struct chan_ops tty_ops = {
.type = "tty", .type = "tty",
.init = tty_chan_init, .init = tty_chan_init,
...@@ -74,7 +67,7 @@ struct chan_ops tty_ops = { ...@@ -74,7 +67,7 @@ struct chan_ops tty_ops = {
.close = generic_close, .close = generic_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = tty_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = generic_free, .free = generic_free,
.winch = 0, .winch = 0,
......
...@@ -194,13 +194,6 @@ static void xterm_free(void *d) ...@@ -194,13 +194,6 @@ static void xterm_free(void *d)
free(d); free(d);
} }
static int xterm_console_write(int fd, const char *buf, int n, void *d)
{
struct xterm_chan *data = d;
return(generic_console_write(fd, buf, n, &data->tt));
}
struct chan_ops xterm_ops = { struct chan_ops xterm_ops = {
.type = "xterm", .type = "xterm",
.init = xterm_init, .init = xterm_init,
...@@ -208,7 +201,7 @@ struct chan_ops xterm_ops = { ...@@ -208,7 +201,7 @@ struct chan_ops xterm_ops = {
.close = xterm_close, .close = xterm_close,
.read = generic_read, .read = generic_read,
.write = generic_write, .write = generic_write,
.console_write = xterm_console_write, .console_write = generic_console_write,
.window_size = generic_window_size, .window_size = generic_window_size,
.free = xterm_free, .free = xterm_free,
.winch = 1, .winch = 1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment