diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 01:26:41 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 09:43:04 -0700 |
commit | e99525f9706900417f37721e601d2b414d41bfee (patch) | |
tree | fb407ea65a7c4c8bf457dd2ccab98842570cc62f /arch/um/drivers/xterm.c | |
parent | 79f662334fefa2dd3fdf66c44a4d2dca5e378ab4 (diff) |
uml: console subsystem tidying
This does a lot of cleanup on the UML console system. This patch should be
entirely non-functional.
The tidying is as follows:
header cleanups - the includes should be closer to minimal and complete
all printks now have a severity
lots of style fixes
fd_close is restructured a little in order to reduce the nesting
some functions were calling the os_* wrappers when they can
call libc directly
port_accept had a unnecessary variable
it also tested a pid unecessarily before killing it
some functions were made static
xterm_free is gone, as it was identical to generic_free
Signed-off-by: Jeff Dike <jdike@linux.intel.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/drivers/xterm.c')
-rw-r--r-- | arch/um/drivers/xterm.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c index fd817e541543..87e18bf2c667 100644 --- a/arch/um/drivers/xterm.c +++ b/arch/um/drivers/xterm.c @@ -3,18 +3,19 @@ * Licensed under the GPL */ +#include <stddef.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> -#include <string.h> #include <errno.h> +#include <string.h> #include <termios.h> #include "chan_user.h" +#include "kern_constants.h" #include "os.h" -#include "init.h" +#include "um_malloc.h" #include "user.h" #include "xterm.h" -#include "kern_constants.h" struct xterm_chan { int pid; @@ -29,7 +30,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts) { struct xterm_chan *data; - data = malloc(sizeof(*data)); + data = kmalloc(sizeof(*data), UM_GFP_KERNEL); if (data == NULL) return NULL; *data = ((struct xterm_chan) { .pid = -1, @@ -207,11 +208,6 @@ static void xterm_close(int fd, void *d) os_close_file(fd); } -static void xterm_free(void *d) -{ - free(d); -} - const struct chan_ops xterm_ops = { .type = "xterm", .init = xterm_init, @@ -221,6 +217,6 @@ const struct chan_ops xterm_ops = { .write = generic_write, .console_write = generic_console_write, .window_size = generic_window_size, - .free = xterm_free, + .free = generic_free, .winch = 1, }; |