static inline unsigned char *alloc_buf(void)
{
- unsigned char *p;
int prio = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
- if (PAGE_SIZE != N_TTY_BUF_SIZE) {
- p = kmalloc(N_TTY_BUF_SIZE, prio);
- if (p)
- memset(p, 0, N_TTY_BUF_SIZE);
- } else
- p = (unsigned char *)get_zeroed_page(prio);
-
- return p;
+ if (PAGE_SIZE != N_TTY_BUF_SIZE)
+ return kmalloc(N_TTY_BUF_SIZE, prio);
+ else
+ return (unsigned char *)__get_free_page(prio);
}
static inline void free_buf(unsigned char *buf)
n_tty_flush_buffer(tty);
if (tty->read_buf) {
free_buf(tty->read_buf);
- tty->read_buf = 0;
+ tty->read_buf = NULL;
}
}
memset(tty->read_buf, 0, N_TTY_BUF_SIZE);
reset_buffer_flags(tty);
tty->column = 0;
- n_tty_set_termios(tty, 0);
+ n_tty_set_termios(tty, NULL);
tty->minimum_to_wake = 1;
tty->closing = 0;
return 0;