-/**
- * tty_buffer_find - find a free tty buffer
- * @tty: tty owning the buffer
- * @size: characters wanted
- *
- * Locate an existing suitable tty buffer or if we are lacking one then
- * allocate a new one. We round our buffers off in 256 character chunks
- * to get better allocation behaviour.
- *
- * Locking: Caller must hold tty->buf.lock
- */
-
-static struct tty_buffer *tty_buffer_find(struct tty_port *port, size_t size)
-{
- struct tty_buffer **tbh = &port->buf.free;
- if (size <= MIN_TTYB_SIZE) {
- if (*tbh) {
- struct tty_buffer *t = *tbh;
-
- *tbh = t->next;
- tty_buffer_reset(t, t->size);
- port->buf.memory_used += t->size;
- return t;
- }
- }
- /* Round the buffer size out */
- size = __ALIGN_MASK(size, TTYB_ALIGN_MASK);
- return tty_buffer_alloc(port, size);
- /* Should possibly check if this fails for the largest buffer we
- have queued and recycle that ? */
-}