Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 20288
b: refs/heads/master
c: 5552c28
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Feb 14, 2006
1 parent db79bcd commit 3cba394
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 303794400992b907b7cac0d91788603636c7e0fe
refs/heads/master: 5552c28f6937d2a2b873d06c6d09b96204722dd0
22 changes: 2 additions & 20 deletions trunk/drivers/char/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,6 @@ static void rs_wait_until_sent(struct tty_struct *, int);
/* Standard COM flags (except for COM4, because of the 8514 problem) */
#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)

/*
* tmp_buf is used as a temporary buffer by serial_write. We need to
* lock it in case the memcpy_fromfs 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.
*/
static unsigned char *tmp_buf;

static inline int serial_paranoia_check(struct esp_struct *info,
char *name, const char *routine)
{
Expand Down Expand Up @@ -1267,7 +1256,7 @@ static int rs_write(struct tty_struct * tty,
if (serial_paranoia_check(info, tty->name, "rs_write"))
return 0;

if (!tty || !info->xmit_buf || !tmp_buf)
if (!tty || !info->xmit_buf)
return 0;

while (1) {
Expand Down Expand Up @@ -2291,11 +2280,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp)
tty->driver_data = info;
info->tty = tty;

if (!tmp_buf) {
tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL);
if (!tmp_buf)
return -ENOMEM;
}
spin_unlock_irqrestore(&info->lock, flags);

/*
* Start up serial port
Expand Down Expand Up @@ -2602,9 +2587,6 @@ static void __exit espserial_exit(void)
free_pages((unsigned long)dma_buffer,
get_order(DMA_BUFFER_SZ));

if (tmp_buf)
free_page((unsigned long)tmp_buf);

while (free_pio_buf) {
pio_buf = free_pio_buf->next;
kfree(free_pio_buf);
Expand Down

0 comments on commit 3cba394

Please sign in to comment.