From: "Paolo 'Blaisorblade' Giarrusso" <blaisorblade@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>
Cc: linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [PATCH 08/11] uml console channels: remove console_write wrappers
Date: Wed, 26 Oct 2005 00:02:18 +0200 [thread overview]
Message-ID: <20051025220217.20010.88625.stgit@zion.home.lan> (raw)
In-Reply-To: <20051025220053.20010.56979.stgit@zion.home.lan>
From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
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>
---
arch/um/drivers/fd.c | 9 +--------
arch/um/drivers/port_user.c | 9 +--------
arch/um/drivers/pty.c | 11 ++---------
arch/um/drivers/tty.c | 9 +--------
arch/um/drivers/xterm.c | 9 +--------
5 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/arch/um/drivers/fd.c b/arch/um/drivers/fd.c
--- a/arch/um/drivers/fd.c
+++ b/arch/um/drivers/fd.c
@@ -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 = {
.type = "fd",
.init = fd_init,
@@ -90,7 +83,7 @@ struct chan_ops fd_ops = {
.close = fd_close,
.read = generic_read,
.write = generic_write,
- .console_write = fd_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 1,
diff --git a/arch/um/drivers/port_user.c b/arch/um/drivers/port_user.c
--- a/arch/um/drivers/port_user.c
+++ b/arch/um/drivers/port_user.c
@@ -101,13 +101,6 @@ static void port_close(int fd, void *d)
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 = {
.type = "port",
.init = port_init,
@@ -115,7 +108,7 @@ struct chan_ops port_ops = {
.close = port_close,
.read = generic_read,
.write = generic_write,
- .console_write = port_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = port_free,
.winch = 1,
diff --git a/arch/um/drivers/pty.c b/arch/um/drivers/pty.c
--- a/arch/um/drivers/pty.c
+++ b/arch/um/drivers/pty.c
@@ -118,13 +118,6 @@ static int pty_open(int input, int outpu
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 = {
.type = "pty",
.init = pty_chan_init,
@@ -132,7 +125,7 @@ struct chan_ops pty_ops = {
.close = generic_close,
.read = generic_read,
.write = generic_write,
- .console_write = pty_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
@@ -145,7 +138,7 @@ struct chan_ops pts_ops = {
.close = generic_close,
.read = generic_read,
.write = generic_write,
- .console_write = pty_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
diff --git a/arch/um/drivers/tty.c b/arch/um/drivers/tty.c
--- a/arch/um/drivers/tty.c
+++ b/arch/um/drivers/tty.c
@@ -60,13 +60,6 @@ static int tty_open(int input, int outpu
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 = {
.type = "tty",
.init = tty_chan_init,
@@ -74,7 +67,7 @@ struct chan_ops tty_ops = {
.close = generic_close,
.read = generic_read,
.write = generic_write,
- .console_write = tty_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = generic_free,
.winch = 0,
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
--- a/arch/um/drivers/xterm.c
+++ b/arch/um/drivers/xterm.c
@@ -195,13 +195,6 @@ static void xterm_free(void *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 = {
.type = "xterm",
.init = xterm_init,
@@ -209,7 +202,7 @@ struct chan_ops xterm_ops = {
.close = xterm_close,
.read = generic_read,
.write = generic_write,
- .console_write = xterm_console_write,
+ .console_write = generic_console_write,
.window_size = generic_window_size,
.free = xterm_free,
.winch = 1,
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
next prev parent reply other threads:[~2005-10-25 22:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-25 22:00 [uml-devel] [PATCH 01/11] uml: sigio code - reduce spinlock hold time Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 02/11] Uml: fix access_ok Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 03/11] uml: fix signal code x86-64 [for 2.6.15] Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 04/11] uml: fix SKAS0 assembly stubs - use proper constraints Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 05/11] uml: fix assembly stub for segv Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 06/11] uml: remove bogus WARN_ON, triggerable harmlessly on a page fault race Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:01 ` [uml-devel] [PATCH 07/11] uml: fix mcast network driver error handling Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:02 ` Paolo 'Blaisorblade' Giarrusso [this message]
2005-10-25 22:02 ` [uml-devel] [PATCH 09/11] uml console channels: fix the API of console_write Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:02 ` [uml-devel] [PATCH 10/11] uml: avoid malloc to sleep in atomic sections Paolo 'Blaisorblade' Giarrusso
2005-10-25 22:03 ` [uml-devel] [PATCH 11/11] uml: micro fixups to arch Kconfig Paolo 'Blaisorblade' Giarrusso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051025220217.20010.88625.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox