[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>
This commit is contained in:
committed by
Linus Torvalds
parent
1d2c8eea69
commit
b3218a79aa
@@ -33,8 +33,6 @@
|
||||
|
||||
#define DEBUG
|
||||
|
||||
static char * tmp_buf;
|
||||
|
||||
static int gs_debug;
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -205,7 +203,7 @@ int gs_write(struct tty_struct * tty,
|
||||
if (!tty) return -EIO;
|
||||
|
||||
port = tty->driver_data;
|
||||
if (!port || !port->xmit_buf || !tmp_buf)
|
||||
if (!port || !port->xmit_buf)
|
||||
return -EIO;
|
||||
|
||||
local_save_flags(flags);
|
||||
@@ -837,24 +835,9 @@ void gs_set_termios (struct tty_struct * tty,
|
||||
int gs_init_port(struct gs_port *port)
|
||||
{
|
||||
unsigned long flags;
|
||||
unsigned long page;
|
||||
|
||||
func_enter ();
|
||||
|
||||
if (!tmp_buf) {
|
||||
page = get_zeroed_page(GFP_KERNEL);
|
||||
spin_lock_irqsave (&port->driver_lock, flags); /* Don't expect this to make a difference. */
|
||||
if (tmp_buf)
|
||||
free_page(page);
|
||||
else
|
||||
tmp_buf = (unsigned char *) page;
|
||||
spin_unlock_irqrestore (&port->driver_lock, flags);
|
||||
if (!tmp_buf) {
|
||||
func_exit ();
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
if (port->flags & ASYNC_INITIALIZED) {
|
||||
func_exit ();
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user