Commit 31fd9d3f authored by Roman Fietze's avatar Roman Fietze Committed by Linus Torvalds

[PATCH] clean up n_tty alloc_buf()

Don't bother zeroing the allocated memory inside alloc_buf() in the
n_tty line discipline.  alloc_buf() is static inline and is only
referenced by n_tty_open() which always clears the memory (once more).

No bug, just a minor cleanup
parent fc393650
......@@ -62,17 +62,12 @@
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment