Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24455
b: refs/heads/master
c: 86a3414
h: refs/heads/master
i:
  24453: 056eacc
  24451: 4a0e881
  24447: f6c0f68
v: v3
  • Loading branch information
Paul Fulghum authored and Linus Torvalds committed Mar 28, 2006
1 parent 18e5703 commit d003708
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 31 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: f5f5370da4b3128b7dfd944b4fcbb5c7b6887348
refs/heads/master: 86a34147d1f1c94e94500e63e83f9fa42548a088
31 changes: 1 addition & 30 deletions trunk/drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,17 +941,6 @@ static void* mgsl_get_text_ptr(void)
return mgsl_get_text_ptr;
}

/*
* tmp_buf is used as a temporary buffer by mgsl_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 ioports, since it significantly saves
* memory if large numbers of serial ports are open.
*/
static unsigned char *tmp_buf;

static inline int mgsl_paranoia_check(struct mgsl_struct *info,
char *name, const char *routine)
{
Expand Down Expand Up @@ -2150,7 +2139,7 @@ static int mgsl_write(struct tty_struct * tty,
if (mgsl_paranoia_check(info, tty->name, "mgsl_write"))
goto cleanup;

if (!tty || !info->xmit_buf || !tmp_buf)
if (!tty || !info->xmit_buf)
goto cleanup;

if ( info->params.mode == MGSL_MODE_HDLC ||
Expand Down Expand Up @@ -3438,7 +3427,6 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
{
struct mgsl_struct *info;
int retval, line;
unsigned long page;
unsigned long flags;

/* verify range of specified line number */
Expand Down Expand Up @@ -3472,18 +3460,6 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp)
goto cleanup;
}

if (!tmp_buf) {
page = get_zeroed_page(GFP_KERNEL);
if (!page) {
retval = -ENOMEM;
goto cleanup;
}
if (tmp_buf)
free_page(page);
else
tmp_buf = (unsigned char *) page;
}

info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;

spin_lock_irqsave(&info->netlock, flags);
Expand Down Expand Up @@ -4502,11 +4478,6 @@ static void synclink_cleanup(void)
kfree(tmp);
}

if (tmp_buf) {
free_page((unsigned long) tmp_buf);
tmp_buf = NULL;
}

if (pci_registered)
pci_unregister_driver(&synclink_pci_driver);
}
Expand Down

0 comments on commit d003708

Please sign in to comment.