Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: Merge __tty_flush_buffer() into lone call site

__tty_flush_buffer() is now only called by tty_flush_buffer();
merge functions.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Peter Hurley and committed by
Greg Kroah-Hartman
47aa658a 0f56bd2f

+6 -23
+6 -23
drivers/tty/tty_buffer.c
··· 151 151 } 152 152 153 153 /** 154 - * __tty_buffer_flush - flush full tty buffers 155 - * @tty: tty to flush 156 - * 157 - * flush all the buffers containing receive data. Caller must 158 - * hold the buffer lock and must have ensured no parallel flush to 159 - * ldisc is running. 160 - */ 161 - 162 - static void __tty_buffer_flush(struct tty_port *port) 163 - { 164 - struct tty_bufhead *buf = &port->buf; 165 - struct tty_buffer *next; 166 - 167 - while ((next = buf->head->next) != NULL) { 168 - tty_buffer_free(port, buf->head); 169 - buf->head = next; 170 - } 171 - WARN_ON(buf->head != buf->tail); 172 - buf->head->read = buf->head->commit; 173 - } 174 - 175 - /** 176 154 * tty_buffer_flush - flush full tty buffers 177 155 * @tty: tty to flush 178 156 * ··· 166 188 { 167 189 struct tty_port *port = tty->port; 168 190 struct tty_bufhead *buf = &port->buf; 191 + struct tty_buffer *next; 169 192 170 193 buf->flushpending = 1; 171 194 172 195 mutex_lock(&buf->flush_mutex); 173 - __tty_buffer_flush(port); 196 + while ((next = buf->head->next) != NULL) { 197 + tty_buffer_free(port, buf->head); 198 + buf->head = next; 199 + } 200 + buf->head->read = buf->head->commit; 174 201 buf->flushpending = 0; 175 202 mutex_unlock(&buf->flush_mutex); 176 203 }