diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-10-04 02:15:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 07:55:13 -0700 |
commit | b3218a79aa3d58b975b066c300153a8520f7051c (patch) | |
tree | ecdbadacd84a00682bf047c0cdae1194cad3c38c /drivers/char/cyclades.c | |
parent | 1d2c8eea698514cfaa53fc991b960791d09508e1 (diff) | |
download | kernel-crypto-b3218a79aa3d58b975b066c300153a8520f7051c.tar.gz kernel-crypto-b3218a79aa3d58b975b066c300153a8520f7051c.tar.xz kernel-crypto-b3218a79aa3d58b975b066c300153a8520f7051c.zip |
[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/cyclades.c')
-rw-r--r-- | drivers/char/cyclades.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index f85b4eb1661..87b2fb51087 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -748,18 +748,6 @@ static struct cyclades_port cy_port[NR_PORTS]; static int cy_next_channel; /* next minor available */ /* - * tmp_buf is used as a temporary buffer by serial_write. We need to - * lock it in case the copy_from_user blocks while swapping in a page, - * and some other program tries to do a serial write at the same time. - * Since the lock will only come under contention when the system is - * swapping and available memory is low, it makes sense to share one - * buffer across all the serial ports, since it significantly saves - * memory if large numbers of serial ports are open. This buffer is - * allocated when the first cy_open occurs. - */ -static unsigned char *tmp_buf; - -/* * This is used to look up the divisor speeds and the timeouts * We're normally limited to 15 distinct baud rates. The extra * are accessed via settings in info->flags. @@ -2466,7 +2454,6 @@ cy_open(struct tty_struct *tty, struct file * filp) { struct cyclades_port *info; int retval, line; - unsigned long page; line = tty->index; if ((line < 0) || (NR_PORTS <= line)){ @@ -2545,15 +2532,6 @@ cy_open(struct tty_struct *tty, struct file * filp) printk("cyc:cy_open (%d): incrementing count to %d\n", current->pid, info->count); #endif - if (!tmp_buf) { - page = get_zeroed_page(GFP_KERNEL); - if (!page) - return -ENOMEM; - if (tmp_buf) - free_page(page); - else - tmp_buf = (unsigned char *) page; - } /* * If the port is the middle of closing, bail out now @@ -2832,7 +2810,7 @@ cy_write(struct tty_struct * tty, const unsigned char *buf, int count) return 0; } - if (!info->xmit_buf || !tmp_buf) + if (!info->xmit_buf) return 0; CY_LOCK(info, flags); @@ -5490,10 +5468,6 @@ cy_cleanup_module(void) #endif } } - if (tmp_buf) { - free_page((unsigned long) tmp_buf); - tmp_buf = NULL; - } } /* cy_cleanup_module */ module_init(cy_init); |