aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/generic_serial.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-10-04 05:15:27 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-04 10:55:13 -0400
commitb3218a79aa3d58b975b066c300153a8520f7051c (patch)
treeecdbadacd84a00682bf047c0cdae1194cad3c38c /drivers/char/generic_serial.c
parent1d2c8eea698514cfaa53fc991b960791d09508e1 (diff)
[PATCH] char: kill unneeded memsets
char, another tmp_buf cleanup No need to allocate one page as a side buffer. It's no more used. Clean this (de)allocs of this useless memory pages in char subtree. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/generic_serial.c')
-rw-r--r--drivers/char/generic_serial.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c
index 4711d9b3a595..87127e49c0db 100644
--- a/drivers/char/generic_serial.c
+++ b/drivers/char/generic_serial.c
@@ -33,8 +33,6 @@
33 33
34#define DEBUG 34#define DEBUG
35 35
36static char * tmp_buf;
37
38static int gs_debug; 36static int gs_debug;
39 37
40#ifdef DEBUG 38#ifdef DEBUG
@@ -205,7 +203,7 @@ int gs_write(struct tty_struct * tty,
205 if (!tty) return -EIO; 203 if (!tty) return -EIO;
206 204
207 port = tty->driver_data; 205 port = tty->driver_data;
208 if (!port || !port->xmit_buf || !tmp_buf) 206 if (!port || !port->xmit_buf)
209 return -EIO; 207 return -EIO;
210 208
211 local_save_flags(flags); 209 local_save_flags(flags);
@@ -837,24 +835,9 @@ void gs_set_termios (struct tty_struct * tty,
837int gs_init_port(struct gs_port *port) 835int gs_init_port(struct gs_port *port)
838{ 836{
839 unsigned long flags; 837 unsigned long flags;
840 unsigned long page;
841 838
842 func_enter (); 839 func_enter ();
843 840
844 if (!tmp_buf) {
845 page = get_zeroed_page(GFP_KERNEL);
846 spin_lock_irqsave (&port->driver_lock, flags); /* Don't expect this to make a difference. */
847 if (tmp_buf)
848 free_page(page);
849 else
850 tmp_buf = (unsigned char *) page;
851 spin_unlock_irqrestore (&port->driver_lock, flags);
852 if (!tmp_buf) {
853 func_exit ();
854 return -ENOMEM;
855 }
856 }
857
858 if (port->flags & ASYNC_INITIALIZED) { 841 if (port->flags & ASYNC_INITIALIZED) {
859 func_exit (); 842 func_exit ();
860 return 0; 843 return 0;